pascalabcnet/InstallerSamples/!Tutorial/07_CharString/String5.pas

18 lines
826 B
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Строки. Стандартные подпрограммы работы со строками (Copy устарела - используйте срезы)
var
s: string := ' Pascal__NET ';
s1: string := 'NET';
begin
Writeln('Исходная строка: ''',s,' ''');
s := Trim(s);
Writeln('После вызова функции Trim: ''',s,' ''');
var p := Pos(s1,s);
WritelnFormat('Позиция подстроки ''{0}'' в строке ''{1}'' равна {2}',s1,s,p);
Delete(s,7,2);
Writeln('После удаления символов __: ',s);
Insert('ABC.',s,7);
Writeln('После вставки подстроки ''ABC.'': ',s);
Writeln('Первая часть строки: ',Copy(s,1,9));
Writeln('Последняя часть строки: ',Copy(s,11,3));
end.