The substr() method extracts the characters from a string, beginning at “start” and through the specified number of character, and returns the new sub string.
Start – Required. The index where to start the extraction. First character is at index 0.
Length- Optional. The number of characters to extract. If omitted, it extracts the rest of the string.
In the example
First character of “Welcome to www.ispsd.Com” w is removed as seen in output.
First 3 characters of “Welcome to www.ispsd.Com” wel will be removed and after 9 characters rest of the words will be omitted too.
elcome to www.ispsd.Com
come to w