0

Im trying to split the string using

String str = str.split("";"")

the problem is that because I need to split using something that contains " it wont recognize it as one string. what can I do?

M A
  • 71,713
  • 13
  • 134
  • 174

2 Answers2

0

In Java you should use:

String str = str.split("\";\"");

to escape the " character.

I hope it helps.

Leonid Glanz
  • 1,261
  • 2
  • 16
  • 36
0

Your problem is called "escaping" if im not mistaken,y ou can do what you want to do using Regular expressions.

There was a simular question on here already: How to split a string in Java

I find the explanation with the checkmark pretty good, if you want i can explain it to with my words though

Community
  • 1
  • 1