Answer the question
In order to leave comments, you need to log in
How to split a number into an array of numbers?
So far I am using this method
int ci = 12398;
string ac = ci.ToString();
int[] arrInt = new int[ac.Length];
for(int n = 0; n < ac.Length; ++n){
arrInt[n] = int.Parse(ac[n]+ "");
}
Debug.Log("ci = > " + ci);
Debug.Log("[0] = > " + arrInt[0]);
Debug.Log("[1] = > " + arrInt[1]);
Debug.Log("[2] = > " + arrInt[2]);
Debug.Log("[3] = > " + arrInt[3]);
Debug.Log("[4] = > " + arrInt[4]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question