From a string we can get part of the string by specifying starting and ending position of the substring. This functions is different than substr function. In substr function we used start point and length of the substring required ( not end point ). Let us try with some examples .
my_string= new String("Welcome to plus2net.com");
The output of above function is plus
Note that one blank space is included in the above output at the left side.