in reply to Re: How to remove everything after last occurrence of a string?
in thread How to remove everything after last occurrence of a string?
Do you still want to go with a regex solution? :-)
No, because the rindex approach is likely to be more maintainable than the regex solution.
While execution time can sometimes be critical, mostly it doesn't matter at all. It is generally much more important for code to be correct and maintainable than fast. If fast is a side effect of correct and maintainable code (often it is) then so much the better, but fast comes way down the list during the first stages of designing a coding solution.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to remove everything after last occurrence of a string?
by kcott (Archbishop) on Jun 08, 2022 at 08:47 UTC | |
|
Re^3: How to remove everything after last occurrence of a string?
by AnomalousMonk (Archbishop) on Jun 07, 2022 at 22:41 UTC | |
by GrandFather (Saint) on Jun 07, 2022 at 23:45 UTC | |
by eyepopslikeamosquito (Archbishop) on Jun 08, 2022 at 09:49 UTC |