I’m trying to find the “best” way to insert a break into a string of time so that it takes up two lines and always splits in the same place (e.g. Fri Nov 5 11:11 AM to Fri Nov 5 break 11:11 AM).
I do not want to change the width of the div that the string is inside of because an warning message will display there if no time is selected. I know I could split the string into spaces with .split() function and rebuild it into the string I want but I thought there must be a better way.
It would be nice to have a method to traverse (not necessarily divide) thought the string to find an element that occurs more than once. So you could do something like a vocabulary tool that changes the color of the next time(s) you used a word or something for fun like a ransom note generator, newspaper-clipping-like-letters, that uses different letter types for the same word.
For an example what I’m trying to fix is this but a generic solution would be nice.

This will split the string after 2 words and a
1 or 2-digitnumber, if those are followed bytwo1 or 2-digitnumbers separated by a colon followed by eitherAMorPM.