Intercept the string one substring

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     /*the substring () method is used to extract the character of a string intermediary between two specified subscripts. */Ten     /*stringobject.substring (start,stop)*/ One     /* A parameter Description - start required. A nonnegative integer that specifies the position of the first character of the substring to be extracted in the stringobject.  - Stop the Optional. A nonnegative integer that is 1 more than the last character of the substring to extract in Stringobject.  - If this argument is omitted, the returned substring continues until the end of the string.  -     */ -     /* + return value - a new string value that contains a substring of stringobject whose contents are all characters from start to stop-1, with a length of stop minus start.  + Description A the substring returned by the substring () method includes the character at start, but does not include the character at the stop.  at If the argument start is equal to stop, the method returns an empty string (that is, a string of length 0). If start is larger than stop, the method swaps both parameters before extracting the substring.  -     */ -     /* - Hints and notes - Important: Unlike the slice () and substr () methods, substring () does not accept negative parameters.  -     */ in  -     vara="Xcvbnmz"; to     varC=a.substring (3,1); +     varC1=a.substring (1,5); -     varC2=a.substring (1); the         /* * if the parameter value is negative, the value is converted to 0; $     */Panax Notoginseng     varC3=a.substring (1,-3); - Console.log (c); the Console.log (C1); + Console.log (C2); A Console.log (C3); the     </Script> + </Body> - </HTML>

Intercept the string one substring

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.