A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

String类
*           字符串--常量
*                 1.字符串常量可以当做字符串对象
*                 2.字符串是常量,创建以后不能更改(常量池中的内容不能改)
*                 3.可以被共享
*
*         public boolean equals(Object obj) 比较字符串中内容是否相同
*         public boolean equalsIgnoreCase(String str)比较字符串中的内容 不区分大小写
*         public boolean contains(String str) 大串中是否包含小串
*         public boolean startWith(String str) 是不是以小串开头的
*         public boolean endwith(String str) 是不是小串结尾的
*
*         public int length() 获取字符串长度
*         public char charAt(int index) 获取指定位置的字符
*         public String substring(int start,int end) 截取指定范围的字符串
*         public char[] toCharArray() 转换成字符数组
*         public byte[] getByte() 转换和那个字节数组

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马