- Home /
Answer by whydoidoit · May 26, 2012 at 08:05 PM
Just use yourIntVariable.ToString();
Everything in .NET has a .ToString();
If you need to convert back then it is int.Parse(yourString) etc.
Thank you. That worked. I was tripped up by the parenthesis after the .tostring. Never came across anything like that in my web language / vb experience.
No problem - one thing - you should put comments like this as a comment rather than an answer (that just confuses folk :) [Edit: this was an answer when I wrote this, honest :)]
Second thing, please mark the question as answered by clicking on the tick next to my answer above - that removes it from the list that is used to find questions that need attention. (And it keeps my accepted answer % looking better!)
Don't mark this one as the answer though - that is doubly confusing, mark the one I wrote for you.
Ok, I'll make sure to make it a comment when I'm not answering for now on. Got it answer mark co$$anonymous$$g up.
Welcome on board and best of luck with it. Be very aware that Unity Javascript ain't that much like browser Javascript. I sometimes think it's better just to bite the bullet and write C# - that way you $$anonymous$$NOW it's different ;) So keep the faith on that it's the right way to go...
Answer by firemyst · Mar 24, 2014 at 08:07 AM
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:
.ToString() Convert.ToString()
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!
Your answer
![](https://koobas.hobune.stream/wayback/20220613071959im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Download a WWW int? Or convert? 1 Answer
int to string, weird string value? 1 Answer
convert string to int 0 Answers
Convert int to string 2 Answers
Array - Convert Object into Int 5 Answers