I am having a time string like this 9:00:10 AM and 12:10:20 PM.
So I want to remove the seconds value from the above string, so the above should look like this 9:00 AM, 12:10 PM
How can I achieve this
CodePudding user response:
String#replace accepts a regular expression. For example