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.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With