Reputation: 39
I have a string variable. It's 4 digits number. I have to split this string into symbols and put every symbol into different variable. I haven't found how to do it with variables, only with arrays, but using arrays is not allowed. Any thoughts?
Upvotes: 0
Views: 49
Reputation: 689
not sure if i understand the question correctly, but maybe this is a solution?
String strNumber = "1234";
char one = strNumber.charAt(0);
char two = strNumber.charAt(1);
char three = strNumber.charAt(2);
char four = strNumber.charAt(3);
Upvotes: 4