I am planning to split a string in java using regex. My input will be as follows
2010-11-10 00:00:00,999, some string follows
I am using
inputString.split("(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{3},)");
This gives a string[] with two elements, second element is "some string follows" but first element is empty string, how to get the first part of the string.
Update: I cant assume the date will be at the beginning. Sorry for leaving it out earlier.