If the string ends with the search string, remove the search string from the end. If the string start with the search string, remove the search string from the start. The string does not have to be at the start and end to be removed, it may be at either. Otherwise return the passed string unaltered.
The string to search
The string to match
1 2 3 | xf.Str.RemoveFromStartAndEnd( "abracadabra" , "abra" ) => cad xf.Str.RemoveFromStartAndEnd( "abracadabra!" , "abra" ) => cadabra! xf.Str.RemoveFromStartAndEnd( "..abracadabra" , "abra" ) => ..abracad |