substring()

Syntax:

substring( From, To )

Return:

A substring of a string.

Parameters:

From – an integer specifying the position within the string of the first character of the substring. The index position of the first character of a string is 0. This parameter is required.

To – An integer specifying a position within the string that is one greater than the last character of the substring. In other words, the position of the character specified in To is not included in the substring. This parameter is optional; the default value is -1 i.e. the end of the string.

image\Script_Button.jpgExamples

see also:charAt, indexOf, lastIndexOf