- Home /
Question by
Shafee · Apr 23, 2010 at 02:40 PM ·
stringconversion
How do I convert a string to a long integer type
Example converting a string "123456789987654321" to integer value as 123456789987654321.
Comment
Also note that all primitive types have Parse(). $$anonymous$$g. int.Parse("123").
Answer by Molix · Apr 23, 2010 at 03:40 PM
For a long, I think you'll want Convert.ToInt64( "1234567890987654321" );
Answer by Ray-Pendergraph · Apr 23, 2010 at 02:46 PM
Use the Convert class: http://msdn.microsoft.com/en-us/library/dsfy6sz9%28v=VS.100%29.aspx
This doesn't seem to work in UnityScript though. Any ideas?
D'oh, no I wasn't. Thanks! In JavaScript it's import System; but yeah. That's what I was missing!
Your answer
![](https://koobas.hobune.stream/wayback/20220612184607im_/https://answers.unity.com/themes/thub/images/avi.jpg)