Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled.
Removes separators from the end of the string.
Strip a substring from the start/end of a string
Remove the trailing spaces from a string.