IsDigit Function | |
Determine if the leftmost character in a string is a digit (that is, a numeric digit between 0 and 9).
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax FUNCTION IsDigit(
pszString AS STRING
) AS LOGIC
public static bool IsDigit(
string pszString
)
Request Example
View SourceParameters
- pszString
- Type: String
The string to examine.
Return Value
Type:
Logic
TRUE if the first character of the string is a number from 0 to 9; otherwise; FALSE.
Remarks
IsDigit() is useful when you need to know if the current string is a number before converting it to a numeric value with the Val() function.
Examples
These examples demonstrate various results of IsDigit():
1? IsDigit("AbcDe")
2? IsDigit("1abcd")
3? IsDigit(".12345")
See Also