⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.java

📁 实例精华
💻 JAVA
字号:
package STRING;

public class Test {
    public static void main(String[] args) {
        Test test = new Test();

        String a = "abcdef";
        String x = "ABCDE";
        String name = "administrator.com";
        System.out.println("String-a: "+a);
        System.out.println("String-x: "+x);
        System.out.println("String-name: "+name);
        //将一个串连接到别一个串的尾部
        String b = a.concat("ghijkl");
        System.out.println("concat: "+b);

        b = a.replace('b','@');
        System.out.println("replace: "+b);

        b = a.substring(3,6);
        System.out.println("substring: "+b);

        b = a.toUpperCase();
        System.out.println("toUpperCase: "+b);

        b = x.toLowerCase();
        System.out.println("toLowerCase: "+b);

        int c = a.indexOf('a');
        System.out.println("indexOf: "+c);

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -