AnsiMidStr
Belongs to : FunctionDescription
The AnsiMidStr returns a string comprising a sequence of characters from a source string.
It attempts to return Count characters from position Start of the Source.
If Count exceeds the remaining size of the source, the whole of the remainder of the source is returned.
Notes
Strings start with index = 1 (arrays start with 0)
Example code
1 2 3 4 5 6 7 8 9 10 11 12 |
var source, target : AnsiString; begin source := '123456789'; target := AnsiMidStr(source, 2, 4); ShowMessage('Source = '+source); ShowMessage('Target = '+target); end; Show full unit code Source = 123456789 Target = 2345 |