How do you split string at current position?

yes hello :

I am trying to split a line of text after every instance of '|', however I cant seem to figure it out. Here is what i have got so far

char special = '|';
for (int i = 0; i < blobs.length(); i++)
{
  if(blobs.charAt(i) == special)
  {
    String[] splitwords = blobs.split(charAt(i));
  }
user3115056 :

Why don't you simply use blobs.split("\|")

String[] split = blobs.split("\\|");

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=328863&siteId=1