截取逗号后字符 String str = new String ("1,2,3,4,5,6"); String[] str1 = str.split(","); System.out.println(str1[2]);//选择第3个元素 替换指定字符 String s = “abcat”; String s1 = s.replace(‘a’,‘1’);
时间: 2024-10-23 12:49:54
截取逗号后字符 String str = new String ("1,2,3,4,5,6"); String[] str1 = str.split(","); System.out.println(str1[2]);//选择第3个元素 替换指定字符 String s = “abcat”; String s1 = s.replace(‘a’,‘1’);