2013年1月13日 星期日

substring

 

substring (int 開頭位置, int 結束位置)

 

public String substring (int start, int end)

Added in API level 1
Returns a string containing a subsequence of characters from this string. The returned string shares this string's backing array.
Parameters
start the offset of the first character.
end the offset one past the last character.
Returns
  • a new string containing the characters from start to end - 1
Throws
IndexOutOfBoundsException if start < 0, start > end or end > length().

沒有留言:

張貼留言