Parameters: Here the Startindex and Endindex describes the part of the string to be taken as substring. Here the Endindex is optional.
Return value: It returns a new string which is part of the given string.
geek eeksf forgeeks geeksforgeeks
Index alwways start with 0. If still we take index as negative, it will be considered as zero and index can’t be in fraction if it found so, it will be converted into its just lesser whole number.
geeksforgeeks eksforgeeks eksforgeeks
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.