What is the substring method?
Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.
What is the substring method?
Rating:
The substring method belongs to the String object. This method enables the programmers to extract a contiguous range of characters from a string. There are two parameters; start and end, passed in this method. The characters are displayed in the range of numbers between the start and end. The position of the first character is zero. If the value of end is not provided, the end of the string is considered as the endpoint.
The syntax of the substring method is as follows:
The following code will demonstrate the use of the substring method:
var str2=str1.substring(2,5)
trace(str2) //output: str
Rating:
Was this information helpful?
Other articles
- What is a variable?
- What are normal layers?
- What is SWF?
- Tip to rotate the gradient
- What is a symbol?