admin 管理员组

文章数量: 1184232

/**
     * java双引号转义符测试
     * @author asus
     *
     */
    public static void main(String[] args) {
        
        String ont = "\"name\"";        //字符串两边含有双引号    
        String tow = "name \"is\" wgb"; //字符串中间含有双引号    
        String three = "\\name";        //使用转义字符还可以使字符串包含其他字符    
            
        System.out.println("字符串ont  :" + ont);   
        System.out.println("字符串tow  :" + tow);   
        System.out.println("字符串three:" + three);
    }

双引号不能嵌套双引号,否则一对双引号就结束了。

java中双引号中嵌套双引号需要转义:

本文标签: 引号 双引号转 编程