文字列の部分文字列を返す
'hello world'.slice(6); // 'world' 'hello world'.slice(0, 5); // 'hello' 'hello world'.slice(-5); // 'world' (末尾から) 'hello'.substring(1, 3); // 'el'
sliceは負のインデックスに対応しているため、substringより汎用的。末尾からの切り出しにはsliceを使う。
split()
replace() / replaceAll()
includes() / startsWith() / endsWith()
trim() / trimStart() / trimEnd()
前の関数
match() / matchAll()
次の関数
indexOf() / lastIndexOf()