Two things:
1) Not positive, but you might be missing delimiters, which would turn that
into .split("/+/"), which would still be wrong
2) + is a regex special character, meaning "1 or more", you want to escape
it as a literal: .split("/\+/")
Again, not sure if you need the delimiters...
- Dan
On Sun, Jan 3, 2010 at 6:24 PM, Curran <[email protected]> wrote:
> I am currently trying to split a string of a mathematical function,
> which I am currently respresenting as:
>
> 4x2+3x4 (which means 4x^2 + 3x^4)
>
> and I need to split it into the individual terms, 4x2 and 3x4. Using a
> string.split("+") method I get the error:
>
> Syntax Error: U_REGEX_RULE_SYNTAX near index 1: +
>
> how can I prevent this error occurring?
>
> Thanks!
>
> --
> 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]<android-developers%[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