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:

substring(start:Number, end:Number)

The following code will demonstrate the use of the substring method:

var str1="Mystring"
var str2=str1.substring(2,5)
trace(str2) //output: str


Rating:



Other articles

Click here to Article home

 
uCertify.com | Our Company | Articles | Privacy | Security | Contact Us
MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.