How to add backslash to string in Java

I want to add a '\' character to every string in a list of strings... I m doing something like this but it adds 2 backslashes instead.

feedbackMsgs.add(behaviorName+"\\"+fbCode);

result is like: "abc\\def"

how to make sure a single backslash is added??

This question and all comments follow the "Attribution Required."

All Answers

Answers Loading...
Leave a Reply
You must be logged in to post a answer.
About the author