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
  • 23,953
  • 8
  • 45
  • 85
Nitish
  • 13,845
  • 28
  • 135
  • 263

1 Answers1

6

| needs to be escaped so

\\| should do the trick

gtgaxiola
  • 9,241
  • 5
  • 42
  • 64