Delphi has functions System.copy and StrUtils.MidStr that both return a substring from within a string. Is there a difference between these two functions?
If so, what is the difference? And when should I use each one?
Indeed, there is no difference: MidStr() uses Copy(). For strings that is, because Copy() can also be used for arrays, for which MidStr() is not suited.
(Personally, I think that some of the routines published by StrUtils unit are made for those who were comfortable with VB.)
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more