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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -