Saturday, July 2, 2011

[android-developers] String.split(regex) behaving funny

Hello Everybody,

On 3.1, I have a string like this: 130097|2.AQBZGBy6H.600.109.3-4061710|SLC2X7cz9e5-3J68Q . It looks like 3 parts separated by a '|'. So, when I use split on it like this: 

String [] parts = accessToken.split("|"); 

I expect parts to be of length 3. Surprisingly, when i run and step into that part, the length for parts comes to as many characters there are in that string and not 3. So android String.split does not work like java's string.split?

Thanks!!!

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment