substring_java

substring() 方法返回字符串的子字符串。

语法

public String substring(int beginIndex)//返回beginIndex个字符以后的子字符串
或  
public String substring(int beginIndex, int endIndex)//返回从beginIndex个字符到endIndex个字符的子字符串
  • beginIndex -- 起始索引(包括), 索引从 0 开始

  • endIndex -- 结束索引

猜你喜欢

转载自www.cnblogs.com/LieYanAnYing/p/12175665.html