csharp tryparse int

Code Example - csharp tryparse int

                
                        bool success = Int32.TryParse(value, out number);
         if (success)
         {
            Console.WriteLine("Converted '{0}' to {1}.", value, number);
         }
                    
                
 

convert string to int tryparse csharp

                        
                                bool successfullyParsed = int.TryParse(str, out ignoreMe);
if (successfullyParsed){
    // ...
}