Answers for "check if number have certain digits c#"

C#
2

c# how do you check if a string contains only digits

if (str.All(char.IsDigit)) {
  Console.WriteLine("This string only contains numbers");
}
Posted by: Guest on November-08-2020
0

validate int have 3 digits c#

int X = 9;

string PaddedResult = X.ToString().PadLeft (3, '0'); // results in 009
Posted by: Guest on July-10-2020

Code answers related to "check if number have certain digits c#"

C# Answers by Framework

Browse Popular Code Answers by Language