This post will discuss how to convert an integer to a string in C#.

1. Using Int32.ToString() method

A simple and fairly efficient solution is to call the ToString() method on the integer instance to convert it into its equivalent string representation.

Download  Run Code

2. Using Convert.ToString() method

The Convert.ToString() method is used to convert the specified value to its equivalent string representation.

Download  Run Code

3. Using String.Format() method

We can use String.Format() method to insert an integer’s value into another string, as shown below:

Download  Run Code

4. String Interpolation

Starting with C# 6, one can use String interpolation ($), which provides a convenient syntax for converting an integer to a string.

Download  Run Code

5. Concatenation with String.Empty() method

String concatenation in C# is done using the + operator. To convert an integer to a string, simply concat the integer with an empty string.

Download  Run Code

6. Using StringBuilder.Append() method

The StringBuilder.Append() method can be used to append the string representation of the specified integer to the current instance.

Download  Run Code

7. Using String.Concat() method

We can use String.Concat() method to create the string representation of the specified integer.

Download  Run Code

8. Using String.Join() method

The following code example demonstrates how we can use the String.Join() method for generating a string from an integer using an empty string as a separator.

Download  Run Code

That’s all about converting an integer to a string in C#.