my program it does a comparison after splitting the lines, and The problem is solved now, it was counting the ',' with the string which makes the comparison on and off correct, depending on the order of the strings, so if the string i want to match is in the beginning of the line then, a comma will be added which makes the condition of the equality false, and if it comes in the last position in the line then the comma won't appear so the condition is true, so i had to notice the comma in the logcat.(the line changes...)
Thanks for your replies guys. cheers. On Apr 15, 2:19 pm, Farhan Tariq <[email protected]> wrote: > String string = "This is what i want to split"; > String[] tokens = string.split(" "); > > for(int i =0;i<tokens.length;i++){ > Log.d("TOKEN : ", tokens[i]); > > } > > I think you are looking for something like this. This has nothing to do > with android SDK, you should first google your questions up before you post > them here > > > > > > > > On Sun, Apr 15, 2012 at 2:31 PM, Soyer <[email protected]> wrote: > > yes i know its a very beginner question, i even dint expect to be the > > problem with my code, however i tried the other way "String[] t1 = > > str.split(" ");" and for some reason it's still giving me the same > > output. > > > On Apr 15, 2:22 am, Justin Anderson <[email protected]> wrote: > > > This isn't an android question... This is more of a really beginner java > > > question. > > > > That being said, what are you doing to print out the strings? > >http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#sp... > > > > Thanks, > > > Justin Anderson > > > MagouyaWare Developerhttp://sites.google.com/site/magouyaware > > > > On Sat, Apr 14, 2012 at 2:49 PM, Soyer <[email protected]> wrote: > > > > Hello everybody, i am trying to split a line to a set of strings, and > > > > i am using the following bunch of code: > > > > > str = hello welcome to your application > > > > text= X, A > > > > > String t1[]=str.split(" "); > > > > String t2[]=text.split(" "); > > > > > the problem is that the strings (the original ones) are printed > > > > correctly but once it's splatted, it gets printed something like: > > > > > 04-14 21:29:56.985: W/System.err(3427): > > > > ===================132[Ljava.lang.String;@4462ac88 > > > > > before splitting method was: 04-14 21:29:56.985: W/System.err(3427): > > > > ===================133A, X > > > > > Please any help will be very appreciated. > > > > > cheers. > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "Android Developers" group. > > > > To post to this group, send email to > > [email protected] > > > > To unsubscribe from this group, send email to > > > > [email protected] > > > > For more options, visit this group at > > > >http://groups.google.com/group/android-developers?hl=en > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

