top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How substring method work in Java?

0 votes
386 views
How substring method work in Java?
posted Mar 16, 2016 by Diya Borda

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

this is predefined method in java that has two parts :

beginIndex -- the begin index, inclusive.

endIndex -- the end index, exclusive

returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string or up to endIndex - 1 if second argument is given.

ex:
public String substring(int beginIndex)

answer Mar 16, 2016 by Babru Bhan
Similar Questions
0 votes

Write a function which can find the maximum number of vowels out of all the sub-strings which could be formed out of the provided string.

Input:

Maximum length of sub-string: 5
Main String : jondoejumpoverfenceandrun

Output: 3

+4 votes

We pass the argument to inbuilt method then how its internally works?

ex : if we pass large no of character array to subString() method then how this method store this long size character aaray? in this case memory leakage problem occurred?

...