👩💻 判斷字串是否為數字
StringName.All(char.IsDigit);
using System;
using System.Linq;
public class IdentifyString
{
public static void Main()
{
string number = "123456";
if(number.All(char.IsDigit))
{
Console.WriteLine("The Given String is a Number.");
}
else
{
Console.WriteLine("The Given String is Not a Number.");
}
}
}