Hello,
Yet another silly question from yours truly. I need to add escape characters to " and ', so that "monkey's cool" becomes \"monkey\'s cool\". My primitive solution to the problem is as follows:
str1=raw_input("String:")
str1=str1.replace("\'", "\\\'")
str1=str1.replace("\"", "\\\"")
But I bet there is a more efficient and elegant solution to this.
Thank you!
Kind regards,
Dmitri