Copying a substring from a specified string.
function Copy(sSt: string; iFrom, iCount: integer): string;
Parameter |
Type |
Value |
---|---|---|
sSt |
string |
source string; |
iFrom |
integer |
index, from which you need to copy the text, must be >0; |
iCount |
integer |
the number of symbols that you need to copy (starting from the specified position). |
Copies and returns the substring based on condition.
const
sSt = 'Hey, hey, I wanna be a rockstar!';
var
s: string;
begin
mLogScript('Original string: "' + sSt + '"', '');
s := copy(sSt, 24, 9);
mLogScript(s, '');
end.
[14:33:07] (Log "Copy"): Original string: "Hey, hey, I wanna be a rockstar!"
[14:33:07] (Log "Copy"): rockstar!