How to enter quotes in a Java string?

后端 未结 10 1340
不知归路
不知归路 2020-11-22 05:38

I want to initialize a String in Java, but that string needs to include quotes; for example: \"ROM\". I tried doing:

String value = \" \"ROM\" \         


        
10条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 06:10

    \ = \\

    " = \"

    new line = \r\n OR \n\r OR \n (depends on OS) bun usualy \n enough.

    taabulator = \t

提交回复
热议问题