I need an optimised way to replace all trailing characters starting from a ‘/’ in a string.
For example:
mytext = "this is my/string"
i want a result like this
mytext = "this is my/text"
only the string after ‘/’ must be replaced and must be done in optimised way. can anyone find a solution for me?
This seems to be fastest:
What I’ve tested: