1

I have a string completeString

String completeString = "Comp 30440 Software Engineering Project|20-credit module|Is part of your(Conversion) Programme.Deals with the creation of a twitter sentiment analysis application";

I am trying to split this string using

String[] array = completeString.split("|");  

and when I am getting the first element

String first = array[0];  

I am getting empty string. For next two elements I am getting only first letters i.e C and O (Comp).

Colonel Thirty Two
  • 20,587
  • 7
  • 38
  • 76
Nitish
  • 13,487
  • 26
  • 128
  • 252

1 Answers1

6

| needs to be escaped so

\\| should do the trick

gtgaxiola
  • 9,059
  • 5
  • 43
  • 63