MyChat Scripts Engine: Copy
Copying a substring from a specified string.
Syntax
function Copy(sSt: string; iFrom, iCount: integer): string;
Parameters and return values
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). |
Function result
Copies and returns the substring based on condition.
Example
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.
Script work result
[14:33:07] (Log "Copy"): Original string: "Hey, hey, I wanna be a rockstar!"
[14:33:07] (Log "Copy"): rockstar!
See also
Created with the Personal Edition of HelpNDoc: Free Qt Help documentation generator