I have a question on Python string operation:
Here's a string in which there are multiple .(dot),
like:
"a3a.b1b2b.cccc.ded.f.g"
The question is to find the content before the last .(dot), which is
"a3a.b1b2b.cccc.ded.f" in this example (We call it as STRING_BEFORE_LAST_DOT)
and we need to replace STRING_BEFORE_LAST_DOT to be STRING_BEFORE_LAST_DOT + "_Approved".
So the result should be:
"a3a.b1b2b.cccc.ded.f_Approved.g".
And some more examples:
"a.b" -> "a_Approved.b"
"first.second.c" -> "first.second_Approved.c"
I can def a function to do so, I'm wondering if there's any advance way, like use .replace() to make it happen. Thanks.
splitandjoin. Have you tried anything yourself so far?