Difference between System.copy and StrUtils.MidStr

Delphi has System.copy and StrUtils.MidStr functions that return a substring from within a string . Is there a difference between the two?

If so, what is the difference? And when should you use each of them?

+4
source share
1 answer

In fact, it MidStr() no difference: MidStr() uses Copy() . For strings that are, because Copy() can also be used for arrays for which MidStr() not suitable.

(Personally, I believe that some of the routines published by the StrUtils block StrUtils designed for those who are comfortable with VB.)

+8
source

Source: https://habr.com/ru/post/1446383/


All Articles