"Для разработчиков", "Серверные скрипты", "Описание функций", "Строки", "Length".
Получить количество символов в текстовой строке.
function Length(sSt: string): integer;
Параметр |
Тип |
Значение |
---|---|---|
sSt |
string |
оригинальная строка. |
Возвращает длину строки в символах.
var
sData: array[1..4] of string;
i: integer;
begin
sData[1] := 'If I take you home tonight';
sData[2] := 'I will think of songs to sing to you';
sData[3] := 'Music filled with joy and light ';
sData[4] := 'If I take you home tonight';
for i := 1 to 4 do
mLogScript(sData[i], inttostr(length(sData[i])) + ' symbols');
end.
[14:31:39] (Log "Length"): [26 symbols] If I take you home tonight
[14:31:39] (Log "Length"): [36 symbols] I will think of songs to sing to you
[14:31:39] (Log "Length"): [32 symbols] Music filled with joy and light
[14:31:39] (Log "Length"): [26 symbols] If I take you home tonight