What is the substring method?

December 30th, 2007 by uCertify Leave a reply »

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

Download practice question and study guide for ace-flash for exam. Get certified in first attempt download 9A0-311 - Macromedia Flash Professional simulation.
Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
  • Share/Bookmark
Advertisement

Leave a Reply

uCertify.com | Our Company | Articles | Contact Us | News and Press Release | uCertify India | Entries (RSS)
MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD    Cisco Certification: CCNA, CCENT    A+, Network+, Security+ Project+
Oracle Certification: OCP 11g, OCP 10g, OCA 11g, OCA 10g    CIW foundation    EC-212-32,    CISSP    Photoshop ACE CS4    Adobe Flash ACE, PMP, CAPM
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.