Java split and throw away on repeated char using regex -


I am still struggling with regex ...

I have read and seen a lot In all the examples, but are unable to find answers. I want to split the string when the string "::" is found, and I would like to relinquish those two characters. The closest I got was that it was divided on the right pattern, but he kept the colon. Here is an example of my input and desired output:

  string input = "one :: two :: three";  

I should be output:

  output [0]: "one" output [1]: "two" output [2]:  String # Split ()  

code> method which argues to a separator string And outputs the split string in an array. Note that the argument can be a regular expression.

  string input = "a :: two :: three"; String [] output = input. Split ("::"); Println (production [0]); // a System.out.println (output [1]); // two System.out.println (output [2]); There are official documents for // three  

here


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -