I’m searching for a solution to convert char sequences like ‘\”n’ to ‘\n’ without writing a switch for all possible whitespace commands like (‘\t’, ‘\r’, ‘\n’, etc.)
Is there something build in or a clever trick to do that?
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.
No, once compiled,
"\\n"has nothing to do with"\n"afaik. I would suggest doing something as follows:Pure Java:
Using Apache Commons StringEscapeUtils: