c# check if string is all numbers

C#
if (str.All(char.IsDigit)) {
  // String only contains numbers
}
Source

Also in C#: