If I want to check every char in a String using String.charAt(int i)
, would it count from start every time or it is converted to an array automatically and get the charAt
index directly?
Would it be more efficient if I create a char array by String.toCharArray()
and then go through the array by index?
Can I check this up in JavaDoc? Where?