> For the complete documentation index, see [llms.txt](https://hemantajax-2.gitbook.io/es6-in-depth/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hemantajax-2.gitbook.io/es6-in-depth/template-string/new-string-methods.md).

# New String Methods

```javascript
let str = "I am string";
console.log(str.startsWith("I")); // true
// starts with after n character
console.log(str.startsWith("am", 2)); // true


console.log(str.endsWith("ng")); // true
// take 1st 10 char
console.log(str.endsWith("rin", 10)); // true


console.log(str.repeat(2)); // I am stringI am string
console.log(str.includes('rin')); // true (it's case sensitive)
```
