| Description |
GetNumericValue attempts to treat the supplied Char as a numeric digit character (IsDigit = true), returning this value as a Double number.
If the Char cannot be treated as a numeric digit, -1 is returned.
The supplied Char can be from Index position in a CharString.
|
| | Notes | Static methods are not methods of an object - they are simply class functions or procedures available at any time.
|
|
| Microsoft MSDN Links |
System
System.Char
|
|
|
| An example of both syntaxes |
program Project1;
{$APPTYPE CONSOLE}
var
result : Double;
charStr : String;
begin
// From a supplied character
result := System.Char.GetNumericValue('2');
Console.WriteLine(result.ToString);
// From a position in a string
charStr := '0123456789';
result := System.Char.GetNumericValue(charStr, 5);
Console.WriteLine(result.ToString);
Console.ReadLine;
end.
| | Show full unit code | 2
5
|
| |
|
|
|