Useful String Methods and Properties
- .length
- .indexOf(str, [offset]) ES1
- .search(str) ES3
- .lastIndexOf(str) ES1
- .includes(str) ES6
- .startsWith(str) ES6
- .endsWith(str) ES6
- .slice(start, [end]) ES3
- .substring(start, [indexEnd]) ES3
- .substr(start, [length]) ES3
- .replace(find, replace)
- .charAt(number) ES1
- .concat(str) ES3
- .repeat(number) ES6
- .match(regexp) ES3
- .trim() ES5
- .split(separator, [limit]) (sep is string or regex) ES3
- .toLowerCase(str) ES1
- .toUpperCase(str) ES1
- .toString() ES3 (like ruby inspect, I think console.log calls this)
- [@@iterator]()