ICultureInfo.IsInteger

Syntax

IsInteger(Value: String): Boolean;

Parameters

Value. Value converted into integer type.

Description

The IsInteger method returns whether it is possible to convert into integer number according to the current regional standard settings.

Comments

The method returns True if conversion is available, and False if it is impossible. The ParseInteger or TryParseInteger method can be used for conversion.

Example

Sub UserProc;
Var
    CI: ICultureInfo;
Begin
    CI := CultureInfo.Invariant;
    Debug.WriteLine(CI.IsInteger("123"));
    Debug.WriteLine(CI.IsInteger("123,123"));
    Debug.WriteLine(CI.IsInteger("123 123"));
    CI := CultureInfo.CurrentUi;
    Debug.WriteLine(CI.IsInteger("123"));
    Debug.WriteLine(CI.IsInteger("123,123"));
    Debug.WriteLine(CI.IsInteger("123 123"));
End Sub UserProc;

On executing the example it will be checked if the specified string values can be converted into integer numbers. The check is made according to regional settings of invariant culture and visual interface culture of the current application. The check results will be displayed in the development environment console.

See also:

ICultureInfo