convert writeline to int code example Example 1: string to int c# int x = Int32.Parse("1234"); Example 2: C# convert string to int int x = Convert.ToInt32("1234");