+ 1
How to get individual chars from a single string
how to store '1' from ''1455"
1 ответ
+ 5
You can use charAt(index) or make a char array from the string and use the index to get the specific char.
String s = "1455";
char ch = s.charAt(0); // ch = '1'
or
char[] chArr = s.toCharArray();
char ch = chArr[0];
https://docs.oracle.com/javase/7/docs/api/java/lang/String.html