Intercept the string one substr

Source: Internet
Author: User

1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4     <MetaCharSet= "UTF-8">5     <title>Intercept the string one substring</title>6 </Head>7 <Body>8     <Script>9     /*string Interception*/Ten     /* One Definition and Usage A The substr () method extracts a specified number of characters from the start subscript in a string.  - Grammar - stringobject.substr (start,length) the parameter Description - start required. The starting subscript for the substring to extract. Must be numeric. If it is a negative number, the argument declares the position from the end of the string. That is,-1 refers to the last character in the string, 2 refers to the second-lowest character, and so on.  - length is optional. The number of characters in the substring. Must be numeric. If this argument is omitted, then the string from the beginning of the stringobject to the end is returned.  - return value + A new string that contains the length characters starting at the start of the Stringobject, including the character that the start refers to. If length is not specified, the returned string contains the character from start to the end of Stringobject.  -     */ +     vara= "zxcvbnm"; A     varb=A.substr (-3,2); at Console.log (b); -     </Script> - </Body> - </HTML>

Intercept the string one substr

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.