Mauricio Junior - MCP Microsoft (WEB & Windows Application)

Tudo sobre .NET - Artigos, vídeos, livros, ebooks e muito mais.
 
posts - 250, comments - 84, trackbacks - 0

IsWholeNumber

Posted at Wednesday, November 21, 2007 1:58 PM

IsWholeNumber

Verifica se o texto representa um número inteiro válido. Caso o texto informado seja um número inteiro (apenas caracteres entre '0' e '9'), retorna true, do contrário retorna false.

 

  private static bool IsWholeNumber(string strNumber) {

         return !new Regex("[^0-9]").IsMatch(strNumber);

      }

 

 

Espero ter ajudado.

Mauricio Junior - www.mauriciojunior.org

?>

Feedback

No comments posted yet
Title  
Name  
Url
Box Code
Protected by FormShield
Comments