for ( int i=0; i< this .textbox1.text.length; i++)
{
if ( char .IsDigit( this .textbox1.text[i])== false )
// give any error
}
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/47178/