java - Is there a substring(start, length) function? -
i trying use similar method c#'s string.substring(int start, int length)
.
but substring function in java string.substring(int start, int end)
.
i want able pass start position , length substring function.
can me solve issue?
it
string mysubstring(string mystring, int start, int length) { return mystring.substring(start, math.min(start + length, mystring.length())); }
Comments
Post a Comment