Tuesday, September 28, 2010

[android-developers] Re: String.split("\t") results vary with source of string

Yeah, I've never played with split, and the documentation is less than
helpful, but it may be that it's necessary to use ".*\t" or some
such. (Regex has always made my head hurt.)

On Sep 28, 3:18 pm, Filip Havlicek <havlicek.fi...@gmail.com> wrote:
> Hi,
>
> with regexps you can pretty much start herehttp://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Patt...
> if you have more questions, investigate further (just search for
> regexp
> and it will return a lot of results).
>
> Best regards,
> Filip Havlicek
>
> 2010/9/28 john brown <johnbrowngreybe...@gmail.com>
>
> > Oops!
>
> > The \\ actually did work. It just let me get further into my code
> > where I discovered "other errors".
>
> > I think I can work out of this problem but I would like to understand
> > this subject better if anybody can shed any light in this direction.
>
> > Thanks, John Brown
>
> > On Sep 28, 1:54 pm, TreKing <treking...@gmail.com> wrote:
> > > On Tue, Sep 28, 2010 at 12:06 PM, john brown
> > > <johnbrowngreybe...@gmail.com>wrote:
>
> > > > What is the error in my understanding of the split() method?
>
> > > I don't have an actual answer for you, but I ran into the same issue
> > where I
> > > was trying to parse a server response string delimited by the pipe and it
> > > failed miserably, as you've seen. The asterisk "*" was also a problem if
> > I
> > > recall correctly.
>
> > > I didn't investigate too thoroughly, but I think these (and probably
> > others)
> > > might be special characters in the split logic for regex stuff, but
> > that's
> > > just a guess.
>
> > > If you have control over the server, I'd say just use a different
> > delimiter.
> > > If you don't, you can do what I did and first replace the offending
> > > character with something else you know will not exist in the string and
> > > split on that. Lame, but it works.
>
> > ---------------------------------------------------------------------------
> > ----------------------
> > > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> > > transit tracking app for Android-powered devices
>
> > --
> > 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<android-developers%2Bunsubscribe@googlegroups.com>
> > 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 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