pascalabcnet/InstallerSamples/NETLibraries/System.String/StringMethods2.pas
Mikhalkovich Stanislav c2347e604b Примеры - устранил неточности
LightPT - имя сервера вынес в публичную секцию
2025-01-04 14:44:51 +03:00

35 lines
879 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.

begin
// Извлечение подстрок
var s1 := 'ABCDEFGH';
var 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.