In the following example, the regular expression is defined in replace and includes the ignore case flag. Executes the search for a match between a regular expression and a specified string. It can be a variable name or a literal. The following example prints a message which depends on the success of the test. Extracts a section of an string and returns a new string.
Parameters string is a string.
As a negative index, endSlice indicates an offset from the end of the string. If endSlice is omitted, slice extracts to the end of the string. Method of String object Description slice extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. The following example uses slice to create a new string.