How do I make a string with a " character in it? (Java)

后端 未结 4 967
生来不讨喜
生来不讨喜 2021-01-19 12:47

Well that was pretty much my question, I need to do something like this:

String scriptContent = \"print(\"Hello World\")\";
4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-19 13:38

    You can use escape character to do this

    String scriptContent = "print(\"Hello World\")";
    

提交回复
热议问题