Description |
Returns a new string containing the section of the current string statring at index position Start.
Optionally, the extracted section length can be limited to a maximum of Count characters.
|
| Notes | Very Important : Methods in .Net treat strings as starting at 0, unlike traditional Delphi where they started at 1.
Like a lot of string methods, the string object itself is not affected - the modified string is returned for assignment.
|
|
Microsoft MSDN Links |
System
System.String
|
|
|
A simple example |
program Project1;
{$APPTYPE CONSOLE}
var
strA, strB, strC : String;
begin
strA := '0123456789';
strB := strA.SubString(5);
strC := strA.SubString(5, 2);
Console.WriteLine('strA = ' + strA);
Console.WriteLine('strB = ' + strB);
Console.WriteLine('strC = ' + strC);
Console.ReadLine;
end.
| Show full unit code | strA = 0123456789
strB = 56789
strC = 56
|
|
|
|