- Home /
Question by
UnityGuy1243 · Nov 02, 2011 at 11:02 PM ·
arraystringintconvert
Convert Array to String
If I have an array thats like:
var seed : int[] = [1, 2, 3];
How do I make a string out of it like "123"?
Comment
Best Answer
Answer by aldonaletto · Nov 02, 2011 at 11:09 PM
You could use ToString:
var str: String;
for (var i = 0; i < seed.length; i++){
str = str + seed[i].ToString();
}
Answer by gfr · Nov 02, 2011 at 11:22 PM
You could use the `Join()` method of the Array
class:
var str = Array(seed).Join("");
Answer by TAMgames · Oct 16, 2014 at 08:47 AM
I'm not sure this will work but I think you you can just replace int with string...
Instead of using
int[]
just use
string[]
Your answer
Follow this Question
Related Questions
How to convert a string to int array in Unity C# 1 Answer
Array - Convert Object into Int 5 Answers
Converting a string to an int 2 Answers
Why Won't This Work? 1 Answer
"Extract" from a string 1 Answer