In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains how to use the substring () method of javascript. The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use the substring () method of javascript.
In javascript, the substring () method is used to extract characters that are mediated between two specified subscripts, syntax "string.substring (from,to)"; the substring returned by this method includes the character at the "from" parameter, but not the character at the "to" parameter.
The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.
In javascript, the substring () method is used to extract characters that are mediated between two specified subscripts.
Syntax:
The string.substring (from, to) parameter describes that from is required. A non-negative integer that specifies the position of the first character of the substring to be extracted in the string Object. To is optional. A non-negative integer that is 1 more positioned in string Object than the last character of the substring to be extracted.
If this parameter is omitted, the substring returned will go all the way to the end of the string.
The substring returned by the substring () method includes the character at the beginning of the from, but not the character at the end of the to.
Example:
Var str= "Hello world!"; console.log (str.substring (3meme 7))
If the second parameter is omitted, all characters from the start position to the end are extracted.
Var str= "Hello world!"; console.log (str.substring (3))
Thank you for your reading, the above is the content of "how to use the substring () method of javascript". After the study of this article, I believe you have a deeper understanding of how to use the substring () method of javascript, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.