if (textVar.All(c => Char.IsLetterOrDigit(c))) { // String contains only letters & numbers }
if (str.All(char.IsDigit)) { Console.WriteLine("This string only contains numbers"); }