Yes.
It is copy
https://www.freepascal.org/docs-html/rtl/system/copy.html
And UTF8Copy: https://lazarus-ccr.sourceforge.io/docs/lazutils/lazutf8/utf8copy.html (https://lazarus-ccr.sourceforge.io/docs/lazutils/lazutf8/utf8copy.html)
or: https://www.freepascal.org/docs-html/rtl/sysutils/tstringhelper.substring.html
Possible, but only D6 added strutils, so then it must have moved from elsewhere.Or we wrote one ourselves, memory leak, but about strutils introduced in D6 you are right. It is not in D4.
True, but not for long: there is much work being done for a unicode16 based rtl.
You have function Copy: **s://www.freepascal.org/docs-html/rtl/system/copy.html (http://**s://www.freepascal.org/docs-html/rtl/system/copy.html)These two links don't seem to work...
And UTF8Copy: **s://lazarus-ccr.sourceforge.io/docs/lazutils/lazutf8/utf8copy.html (http://**s://lazarus-ccr.sourceforge.io/docs/lazutils/lazutf8/utf8copy.html)
Other midstr option (complete program) using type helper for AnsiString:
{$mode objfpc}{$H+} uses sysutils; begin writeln('Impossible is for the unwilling'.substring(14,3)); // prints for end.
You have function Copy: **s://www.freepascal.org/docs-html/rtl/system/copy.html (http://**://**://**://**://**://**s://www.freepascal.org/docs-html/rtl/system/copy.html)These two links don't seem to work...
And UTF8Copy: **s://lazarus-ccr.sourceforge.io/docs/lazutils/lazutf8/utf8copy.html (http://**://**://**://**://**://**s://lazarus-ccr.sourceforge.io/docs/lazutils/lazutf8/utf8copy.html)
The forum software seems to be borking the urls. Replace ** with h-t-t-p (no dashes).Understood.
Can you assign this to a Variable?Yes. But not on declaration, since substring is a function that is not evaluated at declaration time. But it will if assigned when in the program or procedure body.
Variable:='Impossible is for the unwilling'.substring(14,3)
Got it. 8-)Can you assign this to a Variable?Yes. But not on declaration, since substring is a function that is not evaluated at declaration time. But it will if assigned when in the program or procedure body.
Variable:='Impossible is for the unwilling'.substring(14,3)