'Get two different delimiters from same string
How can I use split function in java using two delimiters in the same string I want to get the words with commas and spaces separately
String I = "hello,hi hellow,bye"
I want to get the above string splited as
String var1 = hello,bye
String var2 = hi hellow
Any suggestion is very much valued.
Solution 1:[1]
I would try to first split them with one of the delimiters, then for each resulting substring split with the other delimiter.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Kinnison84 |
