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

37 lines
888 B
ObjectPascal
Raw Permalink 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.

var s1,s2: string;
begin
// Извлечение подстрок
s1 := 'ABCDEFGH';
s2 := s1.Substring( ачальная_позиция = } 3);
Writeln(s2);
s2 := s1.Substring(3, {длина_подстроки = } 2);
Writeln(s2);
// Вставка, удаление и замена подстрок
s1 := 'ABCDEFGH';
s2 := s1.Insert(2, 'xxx');
Writeln(s2);
s2 := s2.Replace('x', '!');
Writeln(s2);
s2 := s2.Remove(2, 3);
Writeln(s2);
s1 := 'слово слово слово';
s2 := s1.Replace('слов', 'молок');
Writeln(s2);
// Удаление пробельных символов в концах строки
s1 := ' xxx xxx ';
Writeln('|', s1, '|');
s1 := s1.Trim;
Writeln('|', s1, '|');
// Смена регистра символов
s1 := 'абвгд';
s1 := s1.ToUpper;
Writeln(s1);
end.