I have one string such as Date which has the value of Dates. Below is a sample value:
string Date = 05;
When Date is between 01 and 09, Date value should ignore “0”. For example it should be “5”.
If it is “20” means then it should not ignore “0”.
How to do this in C#?
Seems like you’re trying to convert a string to an integer ?
Try
Convert.toInt32(date);which will return an int… then callingToString()will give you the string representation if necessary.