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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Indeed, there is no difference:
MidStr()usesCopy(). For strings that is, becauseCopy()can also be used for arrays, for whichMidStr()is not suited.(Personally, I think that some of the routines published by
StrUtilsunit are made for those who were comfortable with VB.)