procedure TForm1.W3Button17Click(Sender: TObject);
var abc, str : string;
arrStr : array of string;
begin
abc := "Clube Atletico Mineiro";
// After: returns characters after a delimiter
WriteLn(abc.After(" ")); //
// Before: returns characters before a delimiter
WriteLn(abc.Before(" ")); //
WriteLn('------------------');
// DeleteLeft: delete N characters to the left
WriteLn(abc.DeleteLeft(3)); //
WriteLn('------------------');
// DeleteRight: delete N characters to the right
WriteLn(abc.DeleteRight(2)); //
WriteLn('------------------');
// Dupe: duplicate the string N times
WriteLn(abc.Dupe(3)); // Uncaught ReferenceError: DupeString is not defined
WriteLn(DupeString(abc,2)); // Uncaught ReferenceError: DupeString is not defined
WriteLn(StringOfString(abc, 3));
WriteLn('------------------');
str := QuotedStr(abc, '#');
WriteLn(str);
str := str.QuotedString(str);
WriteLn(str);
WriteLn('------------------');
//Right: return N characters to the right
WriteLn(RightStr(abc, 2));
WriteLn('------------------');
//Left: return N characters to the left
WriteLn(LeftStr(abc, 2));
WriteLn('------------------');
// Reverse: returns a version of the string with the character reversed
WriteLn(ReverseString(abc));
WriteLn( abc.Reverse );
WriteLn('------------------');
abc := 'Delphi is the BEST';// then
WriteLn(LeftStr(abc, 5)); // 'Delph'
WriteLn(MidStr(abc, 6, 7));// 'i is th'
WriteLn(RightStr(abc, 6));// 'e BEST'
end;
|