Tuesday 15 April 2014

String.split() java not working -



String.split() java not working -

this question has reply here:

why string.split need pipe delimiter escaped? 3 answers

i have string completestring

string completestring = "comp 30440 software engineering science project|20-credit module|is part of your(conversion) programme.deals creation of twitter sentiment analysis application";

i trying split string using

string[] array = completestring.split("|");

and when getting first element

string first = array[0];

i getting empty string. next 2 elements getting first letters i.e c , o (comp).

| needs escaped so

\\| should trick

java

No comments:

Post a Comment