mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
Merge branch 'gh-pages' of github.com:ruanyf/es6tutorial into gh-pages
This commit is contained in:
commit
c7b7e9736c
@ -232,8 +232,8 @@ ES6 提供字符串实例的`normalize()`方法,用来将字符的不同表示
|
||||
传统上,JavaScript只有`indexOf`方法,可以用来确定一个字符串是否包含在另一个字符串中。ES6又提供了三种新方法。
|
||||
|
||||
- **includes()**:返回布尔值,表示是否找到了参数字符串。
|
||||
- **startsWith()**:返回布尔值,表示参数字符串是否在源字符串的头部。
|
||||
- **endsWith()**:返回布尔值,表示参数字符串是否在源字符串的尾部。
|
||||
- **startsWith()**:返回布尔值,表示参数字符串是否在原字符串的头部。
|
||||
- **endsWith()**:返回布尔值,表示参数字符串是否在原字符串的尾部。
|
||||
|
||||
```javascript
|
||||
var s = 'Hello world!';
|
||||
|
Loading…
x
Reference in New Issue
Block a user