How can I replace all instances of a newline character ASCII code (13) in a string with “\r\n”?
Any help would be appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use this to do it…
Naturally, if you don’t need to pass a variable to get the char code (or if it’s not clearer), use the character in a regex literal, e.g.
/\r/g.