How to put \ "in a String?

1

I'm trying to evaluate a PHP code using Java, so I need to replace all the " with \" in the code. The problem is that Java also has this escape character for " in a String. I was told to use \" , but the result was this:

Doesanyoneknowhowtotypethis?OrsomewaytorunPHPinsidetheJVM?(I'mdoingatrickthatcomesdowntorunningontheterminalecho"codigo" | php ... It's working, but it has this problem with " ). Thanks

    
asked by anonymous 28.07.2017 / 17:58

1 answer

1

Try to use \\" , the first two bars will be transformed into one, for string , and \ " will be the literal character".

    
28.07.2017 / 19:18