The problem is I have a for loop in android , and its seems to be running in the reverse order.
Here is the code :
for(i=0;i<strlent;i++)
{
//ch=st.charAt(i);
//disp(String.valueOf(ch));
disp(String.valueOf(i));
}
I have a string and would like to get each characters out of it, but if I feed in "babe" it runs e-b-a-b. I checked the i
value and it runs as 3-2-1-0. I seriously don't understand why it behaves this way.
This is my disp function
public void disp(String st) // this function is used to check with message boxes
{
AlertDialog.Builder adb = new Builder(this);
adb.setTitle("Testing");
adb.setMessage(st);
adb.show();
}