In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what are the strings 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 "what are the strings of JavaScript".
The JavaScript string stores a series of characters, such as "John Doe". The string can be any text within double or single quotation marks:
JavaScript string
The string is written in quotation marks. You can use single or double quotation marks:
Var carName1 = "Volvo XC60"; / / A double quotation mark var carName2 = 'Volvo XC60'; / / single quote document.getElementById ("demo") [xss_clean] = carName1 + "" + carName2 String attribute method description constructor returns string constructor length returns string length prototype allows you to add properties and method string method description charAt () returns character (position) charCodeAt () returns character at specified index Unicodeconcat () concatenates two or more strings And returns a new connection string endsWith () checks whether the string ends with the specified string / character fromCharCode () converts the Unicode value to the character includes () checks whether the string contains the specified string / character indexOf () returns the position of the specified value found for the first time in the string lastIndexOf () returns the position of the last found specified value in the string localeCompare () compares the current locale The two strings in match () search for strings to find what matches the regular expression And returns the match item repeat () returns the new string replace () with the specified number of existing string copies searches for the specified value or regular expression in the string and returns the new string search () that replaces the specified value searches for the specified value or regular expression in the string And returns the matching position slice () extracts part of the string and returns a new string split () splits the string into an array of substrings startsWith () checks whether the string begins with the specified character substr () extracts the character from the string, starting at the specified starting position Then extract the character toLocaleLowerCase () from the string between two specified indexes by the specified number of characters substring () convert the string to lowercase letters toLocaleUpperCase () according to the locale of the host convert the string to uppercase letters toLowerCase () convert the string to lowercase letters toString () return the value of the String object toUpperCase () convert the string to uppercase letters trim () from the word Delete spaces at both ends of the string valueOf () returns the original value string of the String object HTML wrapper method
The HTML wrapper method returns the string contained in the corresponding HTML tag. These are not standard methods and may not work as expected in all browsers.
Method description anchor () creates an anchor big () uses the big font display string blink () to display the flashing string bold () displays the flashing string fixed () uses the fixed spacing font display string fontcolor () uses the specified color display string fontsize () uses the specified size display string italics () displays the string link () displays the string as a hyperlink small () ) use small font display string strike () display string with delete line sub () display string as subscript text sup () display string as superscript text thank you for reading The above is the content of "what are the strings of JavaScript". After the study of this article, I believe you have a deeper understanding of what the strings of JavaScript have, 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.