package fuxi;
/*
 * public int length();        // 获得字符串长度 
public int indexOf(String str);  // 查找字符
public int lastIndexOf(String str);  // 逆向查找
public boolean startsWith(String prefix);  // 判断开始子串
public boolean endsWith(String suffix);   // 判断结束子串
public char charAt(int index);      // 根据索引得到字符
public int compareTo(String str);   // 字符串比较
public boolean equalsIgnoreCase(String str);  // 判断是否相等
public boolean equals(Object obj);   // 判断是否等值
public String concat(String str);    // 连接字符串 */
public class StringDemo {
    public static void main(String[] args) {
String str1="Helelo";
int length=str1.length();

System.out.println("此字符串的长度为:"+length);

int index=str1.indexOf('e');
System.out.println(" 字母e从前往后第一次出现的位置:"+index);

int index2=str1.lastIndexOf('e');
System.out.println("字符e从后往前查找第一次出现的位置是:"+index2);

boolean b=str1.startsWith("He");
System.out.println("字符串是否是以 He开头的?"+b);

boolean b2=str1.endsWith("loo");
System.out.println("字符串是否是以loo结尾的?"+b2);

char c=str1.charAt(3);
System.out.println("在字符串中下标为3的字符是:"+c);

String str2="uyqeyqx";
System.out.println((int)'H');
System.out.println((int)'u');
int i=str1.compareTo(str2);
System.out.println(i);
boolean b3=str1.equals(str2);
System.out.println("str1与str2两个字符串相等吗?"+b3);
String str3=str1.concat(str2);
System.out.println(str3);

}
}