It can be a variable name or a literal. If successful, search returns the index of the regular expression inside the string. Otherwise, it returns -1. 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.