In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
In this article Xiaobian for you to introduce in detail "how to use indexOf () method to judge a string contains a character in js", the content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to use the indexOf () method to determine that a string contains a character in js" can help you solve your doubts.
1. IndexOf () method
Returns the index number in a string where you want to search for the first occurrence of the string value
If the string value to be retrieved does not appear, the method returns-1.
2. Use grammar
StrObj.indexOf (subString [, startIndex])
3. Parameters
StrObj (required): String object or text.
SubString (required): the substring to find in the String object.
StarIndex (optional): this integer value indicates the index to start the lookup within the String object. If omitted, look at the beginning of the string.
4. Use the indexOf () method to judge that a string contains a character
The let str= "abc" console.log (str.indexOf ("b")! =-1) / / true//indexOf () method returns the position where a specified string value first appears in the string. If the string value to be retrieved does not exist, return-1. This is the end of the article "how to use the indexOf () method in js to determine that a string contains a character." If you want to master the knowledge of this article, you still need to practice and use it. If you want to know more about the articles, you are welcome to follow the industry information channel.
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
1) add_library https://blog.csdn.net/weixin_39956356/article/details/100504979
© 2024 shulou.com SLNews company. All rights reserved.