KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to go through each character in a String and pass each character of the String as a String to another function. String s = "abcdefg"; for(int i = 0; i < s.length(); i++){ newFunction(s.substring(i, i+1));} or String s = "abcdefg"; for(int i = 0; i < s.length(); i++){ newFunction(Character.toString(s.charAt(i)));} The final result needs to be a String. So any idea which will be faster or more efficient?
Tags (comma-separated)
Save Edits
Cancel