Android String Array Manipulation -
In my Android program I have a long string what I want, I need to split each word of that string And to copy each word in a new string array. For example: If the string "I have programmed an Android" and the string array is named my_array, then each index should include this value:
my_array [0] = I my_array [1] = done My_array [2] = Android my_array [3] = Programmer
is a part of the program that I have seen:
StringToKonizer = New stringctonizer (result, "|"); Toast. Make Text (Appointment This, St. NX), TOST. LNGHHIARAT) Show (); While (st.hasMoreTokens ()) {string n = (string) st.nextToken (); Services1 [i] = n; Toast. Make Text (Appointment This, St. NX), TOST. LNGHHIARAT) Show (); }
Can anyone recommend some suggestions ..
Why not use?
You can simply
string [my_array = myStr.split ("\\ s +");
Comments
Post a Comment