String
来源:互联网 发布:无锡灵山大佛淘宝官网 编辑:程序博客网 时间:2024/05/04 09:03
public class StringClass {public static void main(String[] args) {String s = new String("Welcom to Shandong Normal University");System.err.println(s.length());// Returns the length of this string.System.err.println(s.charAt(0));// Returns the char value at the// specified index.System.err.println(s.isEmpty());// Returns true if, and only if,// length() is 0.System.err.println(s.codePointAt(0));// Returns the character(Unicode// code point) at the specified// index.System.err.println(String.valueOf(1));// Returns the string// representation of the int// argument.System.err.println(s.toUpperCase());// Converts all of the characters in// this String to upper case using// the rules of the default locale.System.err.println(s.startsWith("W"));// Tests if this string starts// with the specified prefix.System.err.println(s.split(" "));// Splits this string around matches of// the given regular expression.System.err.println(s.trim());// Returns a copy of the string, with// leading and trailing whitespace// omitted.System.err.println(s.toCharArray());// Converts this string to a new// character array.// character array.System.err.println(s.substring(7, 9));// Returns a new string that is a// substring of this string.System.err.println(s.indexOf("or"));// Returns the index within this// string of the first occurrence of// the specified substring.}}
0 0
- string
- String
- String
- string
- string
- String
- string
- String
- string
- string
- string
- string
- String
- String
- string
- string +
- String
- String
- 换个新号 重新开始
- java中的一些对XML的操作与方法
- js 设置读取cookie
- ios公司开发者帐号申请
- AngularJS入门
- String
- 【Cocos2d-x游戏开发】编译时出现 commands commence before first target
- Leetcode || Remove Nth Node From End of List
- Android 使用OpenCV的三种方式(Android Studio)
- JSON和XML的比较
- 4.2 codecs--Codec注册管理和基类
- [软件]_[Windows]_[参考NSUserDefaults自定义Windows的BASUserDefaults]
- SQL学习记录
- Hadoop---HBase的安装