substring使用

it2022-05-09  67

//转载substringpublic String substring(int beginIndex)返回一个新的字符串,它是此字符串的一个子字符串。该子字符串始于指定索引处的字符,一直到此字符串末尾。例如: "unhappy".substring(2) returns "happy" "Harbison".substring(3) returns "bison" "emptiness".substring(9) returns "" (an empty string)参数:beginIndex - 开始处的索引(包括)。 返回:指定的子字符串。 抛出: IndexOutOfBoundsException - 如果 beginIndex 为负或大于此 String 对象的长度。

转载于:https://www.cnblogs.com/wufengxian/archive/2012/11/26/2788555.html


最新回复(0)