How to declare a string with double quote substrings in Java

1 Answer

0 votes
public class Main {
    public static void main(String[] args) {
        String str = "This is a string with \"double-quoted substring1\", and \"double-quoted substring2\" inside.";
        
        System.out.println(str);
    }
}



/*
run:

This is a string with "double-quoted substring1", and "double-quoted substring2" inside.

*/

 



answered May 12 by avibootz
...