c# try convert string to int if fail code example Example: string to int c# int x = Int32.Parse("1234");