c# convert int to string

I’m new to C# and Unity and I can’t figure out the syntax to convert a long or int number to a string in c#. Any help would be greatly appreciated.

Just use yourIntVariable.ToString();

Everything in .NET has a .ToString();

If you need to convert back then it is int.Parse(yourString) etc.

For anyone who’s curious about the fastest way to convert an int to a string, you can read this webpage.

Basically it’s a toss up between:


until you get to about 21 million conversions.

The code is there too if you want to run it on your own system.

Good luck!