Hello,
I am looking for some help with a RegEx that will ensure there are no spaces at the beginning and end of the file name/string and that there is a single space between each word and hyphen/dash (-)
For example,
Turn this: _____NAME1_______-__________________ NAME2_________-NAME3 (for this example _ represents a white space)
Into this: NAME1 - NAME2 - NAME3 (no white space before or after the file name)
and if it is a single word,
Turn this: NAME1_ (for this example _ represents a white space)
Into this: NAME1 (no white space before or after the file name)
Maybe this is not possible with a single RegEx? The number of NAMES can vary and if there is only one NAME I would like it to not have a space at the beginning and end so when I split the files there isn’t a white space in my file name. I hope that makes sense. Any help with this would be greatly appreciated.