I am trying to add spaces to a string so that I can use it for SimpleDateFormat
. I would need to add spaces to this:
String str = "Wed 3Jun15 03:22:15 pm"
I know how to put it into SimpleDateFormat
as soon as I get it into this format:
String str = "Wed 3 Jun 15 03:22:15 pm"
Eventually I am only trying to pull d, HH:mm
out of this date, so the rest can be trashed.
I have looked at this link: How to split a string between letters and digits (or between digits and letters)? and while it is closed, it doesn't work for what I am trying to do.
This pattern should match your string:
With your example: