* To get a contiguous word from a String then we will use the SubString method.
* SubString(StartIndex, EndIndex) method will accept 2 parameters.
Note :
1. EndIndex is optional. If we don't pass EndIndex then it will print all characters from the given Start Index till the end of the String.
2. Suppose if we pass EndIndex larger than the string length then it won't throw any error instead it will work like the above point.
Example:
1 | Father.substring(1,99) ; //Output : ather |
3. End Index will starts from 1 & Start Index will starts from 0.
Comments
Post a Comment