可以使用 Java 的 String 类的 replaceAll() 方法来将字符串中的空格删除,并使用 toLowerCase() 方法将字符串转换为小写。
例如:
String str = "Hello World";
str = str.replaceAll("\\s", "").toLowerCase();
System.out.println(str); // 输出 "helloworld"
可以使用 Java 的 String 类的 replaceAll() 方法来将字符串中的空格删除,并使用 toLowerCase() 方法将字符串转换为小写。
例如:
String str = "Hello World";
str = str.replaceAll("\\s", "").toLowerCase();
System.out.println(str); // 输出 "helloworld"