Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String line = "3::Daniel::Louis||##2::Leon: the Professional::1994||6::Jean::Reno||7::Gary::Oldman||8::Natalie::Portman||##3::Scarface::1983||9::Al::Pacino||10::Michelle::Pfeiffer";
- for(String s : line.split("||##")) {
- System.out.println("|"+s+"|");
- }
- ||
- |3|
- |:|
- |:|
- |D|
- |a|
- |n|
- |i|
- 3::Daniel::Louis
- Leon: the Professional
- line.split("\|\|##"))
- \|
- |
- for (String s : line.split("\|\|##"))
- Pattern p = Pattern.compile("\|\|##", Pattern.LITERAL)
- String[] result = p.split(myString)
- for(String s : line.split("\|\|##")) {
- for(String s : line.split("\Q||##\E")) {
- Iterable<String> frags = Splitter.on("||##").split(line);
- // Do whatever with the iterable...maybe you just want a list?
- // List<String> fragList = Lists.newArrayList(frags);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement