sly2m (sly2m) wrote,
sly2m
sly2m

Изящное решение нетривиальной задачи

Bool IsNumber (string str)

{
return (str.Replace ("0", "").Replace ("1", "").Replace ("2", "").Replace ("3", "").Replace ("4", "").Replace ("5", "").Replace ("6", "").Replace ("7", "").Replace ("8", "").Replace ("9", "").Length == 0);
}

с башорга.
Tags: код, юмор
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded 

  • 8 comments