Thank you Norm for your patience
for(int count = 0; count < aString.length(); count++)
{
DisplayLetter(aString.charAt(count));
}
I had missed out the curlys, program works now. thanks...
Type: Posts; User: av8
Thank you Norm for your patience
for(int count = 0; count < aString.length(); count++)
{
DisplayLetter(aString.charAt(count));
}
I had missed out the curlys, program works now. thanks...
Another scenario
String String1 = new String();
String1 = "bubble";
String1.charAt(0);
String1.charAt(1);
String1.charAt(2);
String1.charAt(3);
Sorry,
String aString = new String();
aString = "bubble";
for(int count = 0; count < aString.length(); count++)
DisplayLetter(aString.charAt(count));
for(int count = 0; count < aString.length(); count++)
DisplayLetter(aString.charAt(count));
Thanks Norm I've tried this and it displays only the last letter e.
Can you advise on the syntax how to put the loop index into the method call.
Thank you.
I'm getting there slowly. I can have the loop counter as an actual parameter to itererate through a string object
DisplayLetter(String1.charAt(for (int count= 0; count < aString.length; count++));...
String String1 = new String();
String1 = "bubble";
My method : DisplayLetter(char aChar);
If I execute