This repository has been archived on 2024-12-25. You can view files and clone it, but cannot push or open issues or pull requests.
2024-03-10 20:32:51 +03:00

18 lines
759 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.

// Строки. Методы класса string
var
s: string := ' Pascal__NET ';
s1: string := 'NET';
begin
writeln('Исходная строка: ''',s,'''');
s := s.Trim;
writeln('После вызова s.Trim: ''',s,'''');
var p := s.IndexOf(s1); // Индексация - с нуля
writelnFormat('Позиция подстроки ''{0}'' в строке ''{1}'' равна {2}',s1,s,p);
s := s.Remove(6,2);
writeln('После удаления символов __: ',s);
s := s.Insert(6,'ABC.');
writeln('После вставки подстроки ''ABC.'': ',s);
writeln('Первая часть строки: ',s.Substring(0,9));
writeln('Последняя часть строки: ',s.Substring(10,3));
end.