摘要: replace和replaceAll是JAVA中常用的替换字符的方法public String replace(char oldChar, char newChar) 在字符串中用newChar字符替代oldChar字符,返回一个新的字符串 public String replaceAll(Stri 阅读全文
posted @ 2021-10-22 16:09 好(justice)…… 阅读(997) 评论(0) 推荐(0) 编辑
摘要: 4.字符串替换 代码: public class StringReplaceEmp { public static void main(String args[]) { String str="Hello World"; System.out.println(str.replace('H','W') 阅读全文
posted @ 2021-10-22 15:58 好(justice)…… 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 1.Java 实例 - 字符串比较 代码: public class StringCompareEmp { public static void main(String arrgs[]) { String str="hello World";//创建字符串str String antherStrin 阅读全文
posted @ 2021-10-22 15:12 好(justice)…… 阅读(62) 评论(0) 推荐(0) 编辑