Skip to main content
Commonmark migration
Source Link

Checking if the first character of a text is a number can be done in single line, using Char.IsNumber() function as follows:

if ( Char.IsNumber( stringInput, 0) ) {

 
 // String input begins with a number 

}

More information: https://learn.microsoft.com/en-us/dotnet/api/system.char.isnumber

Checking if the first character of a text is a number can be done in single line, using Char.IsNumber() function as follows:

if ( Char.IsNumber( stringInput, 0) ) {

 
 // String input begins with a number 

}

More information: https://learn.microsoft.com/en-us/dotnet/api/system.char.isnumber

Checking if the first character of a text is a number can be done in single line, using Char.IsNumber() function as follows:

if ( Char.IsNumber( stringInput, 0) ) {

 // String input begins with a number 

}

More information: https://learn.microsoft.com/en-us/dotnet/api/system.char.isnumber

Source Link
Gopinath
  • 5k
  • 1
  • 17
  • 19

Checking if the first character of a text is a number can be done in single line, using Char.IsNumber() function as follows:

if ( Char.IsNumber( stringInput, 0) ) {

 // String input begins with a number 

}

More information: https://learn.microsoft.com/en-us/dotnet/api/system.char.isnumber