⬆️ ⬇️

Another pearl issued by the Indians.

I got code written by a single Indian, or rather, I was too lazy to check whether the string is a number using the TryParse method in C # and I decided to see if there is a shorter way. that's what i came across



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 .




Of course, I understand that this is an “optimized” method based on Replace, but it's still funny :).


')

Source: https://habr.com/ru/post/47178/



All Articles