Your question is not clear, in part because it's only newlines that you escape in your example. Please define what you mean by "escaped or raw version of a string". Aside: when you give an example (which is generally most helpful), please assign a variable to each of your input objects (e.g., str = "a,...."). That way, readers can refer to those variables in answers and comments without having to define them.
str = "a,...."). That way, readers can refer to those variables in answers and comments without having to define them.