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

2011-07-02 Thread doles
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

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

2011-07-02 Thread Mark Murphy
http://hoskinator.blogspot.com/2006/11/trouble-using-pipe-with-stringsplit.html. On Sat, Jul 2, 2011 at 3:24 PM, doles sachin.d...@gmail.com wrote: 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

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

2011-07-02 Thread Kostya Vasilyev
The vertical bar has special meaning in Java regular expressions. Use split(\\|) instead. -- Kostya 02.07.2011 23:24, doles пишет: 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

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

2011-07-02 Thread Sachin Dole
Thanks! On Jul 2, 2011 2:37 PM, Kostya Vasilyev kmans...@gmail.com wrote: The vertical bar has special meaning in Java regular expressions. Use split(\\|) instead. -- Kostya 02.07.2011 23:24, doles пишет: Hello Everybody, On 3.1, I have a string like this: