SyntaxFix
Write A Post
Hire A Developer
Questions
A one liner would be :
str=str[::-1].replace(".",".-",1)[::-1]