摘要:
1 public class String01 { 2 public static void main(String[] args){ 3 //查找参数字符串在本来字字符串当中出现的第一次索引位置 4 // 如果根本没有,返回-1 5 String original = "HelloWorld"; 阅读全文
摘要:
1 public class String01 { 2 public static void main(String[] args){ 3 4 //获取指定索引位置的单个字符 5 6 char ch = "Hello".charAt(1);//e 7 System.out.println("在1号索 阅读全文
摘要:
1 public class String01 { 2 public static void main(String[] args){ 3 //拼接字符串 4 5 String str1 = "Hello"; 6 String str2 = "World"; 7 String str3 = str1 阅读全文
摘要:
1 public class String01 { 2 public static void main(String[] args){ 3 //获取字符串的长度 4 int lengh = "HBQ".length(); 5 System.out.println("字符串的长度是"+lengh); 阅读全文