1

I want to change a,b,c to a,b=>c but after finding the last comma index using rfind, how should I replace the , with =>

Aran-Fey
  • 39,665
  • 11
  • 104
  • 149
william007
  • 17,375
  • 25
  • 118
  • 194
  • 4
    Possible duplicate of [Right-to-left string replace in Python?](https://stackoverflow.com/questions/9943504/right-to-left-string-replace-in-python) – damores Mar 05 '18 at 11:24

1 Answers1

4
a = "a,b,c"

'=>'.join(a.rsplit(',',1))

Output:- 'a,b=>c'
Rohit Chopra
  • 567
  • 1
  • 8
  • 24