base64字符串示例
JavaScript | 字符串include()方法 (JavaScript | String includes() Method)
The String.includes() method in JavaScript is used to check if the character is present in the string or not. The method returns True if characters are present in the string else it will return False.
JavaScript中的String.includes()方法用于检查字符串中是否存在字符。 如果字符串中存在字符,则该方法返回True ,否则将返回False 。
The method treats upper and lowercase characters differently.
该方法将大写和小写字符区别对待。
Syntax:
句法:
String.includes(search_character, startindex);
Parameter(s):
参数:
The method accepts one or two characters, first, is the character needed to be found in the string. The second one is optional which is the index from where the search is started.
该方法接受一个或两个字符,首先是需要在字符串中找到的字符。 第二个是可选的,它是开始搜索的索引。
Return value:
返回值:
The return type of this method is boolean.
此方法的返回类型为boolean 。
Browser support: Chrome, Internet explorer, Mozilla, Safari, Opera mini.
浏览器支持: Chrome,Internet Explorer,Mozilla,Safari,Opera mini。
Example:
例:
str = "IncludeHelp"
//"IncludeHelp"
str.includes("k")
//false
str.includes("inc")
//true
str.includes("H", 9)
//false
翻译自: https://www.includehelp.com/code-snippets/string-includes-method-with-example-in-javascript.aspx
base64字符串示例