On Fri, Nov 5, 2010 at 1:05 PM, Achie <krishna.acha...@gmail.com> wrote: > I just found after 2 hours of debugging my code for errors that > TextUtils.split(String, expression); does not work correctly when I > use pipe "|" as the expression. Am I wrong in understanding the method > or is this a bug? > > It works fine when I give it as a pattern ie., [|].
The vertical pipe has semantic meaning in regular expressions. Try escaping it ("\\|"). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 Available! -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en