hello!
somebody please help me...it is very very urgent.
i wanna split an argument
string into array of string as follows:eg:
1) "abc|def|gh\|ij\\kl\m" would split into"abc", "def", "gh|ij\klm"
I did the first part '|'..i tried following way...but could not succeed..please suggest what shall i do not to match '\|' but match just this '|' to create a
pattern.
i did this way
Pattern p = Pattern.compile("[\\| && [^\\\\| ] ]")
spltStrgs = p.split(arg, 0) ;
but still not getting what i wanted as mentioned above.
to say clearly..it is
If you want a "|" character to appear within an output string and not be interpreted as a splitting character, then it must be preceded by the escape character "\". Any character followed by the "\" character will be interpreted literally, and not treated as a special character. In this case, the "\" escape character is thrown away, and the character following it is appended literally to the current output string. So for example, "a|b" would be split as "a", "b" but "a\|b" would not be split and would appear in the output as a single string "a|b".
please answer ASAP...deadline...tomorrow...appreciates the intellectual who helps
basetti