Convert string value to integer by using the int.TryParse

image_pdfimage_print
   
 


using System;
public class MainClass {
    public static void Main() {

        int i;
        bool failure = int.TryParse("qwerty", out i);
        bool success = int.TryParse("123", out i);
    }
}

         
     


This entry was posted in Data Types. Bookmark the permalink.