Answers for "quick way to get charAt"

0

quick way to get charAt

String str = "a really, really long string";
for (int i = 0, n = str.length(); i < n; i++) {
    char c = str.charAt(i);
}
Posted by: Guest on March-03-2021
0

quick way to get charAt

char[] chars = str.toCharArray();
for (int i = 0, n = chars.length; i < n; i++) {
    char c = chars[i];
}
Posted by: Guest on March-03-2021

Browse Popular Code Answers by Language