Skip to content

文本

脚本内容。

const text = 'Hello World Hello Human'

const arr = [
  text.length,
  text.replace('Hello', 'Hi'),
  text.replaceAll('Hello', 'Hi'),
  text.toLowerCase(),
  text.split(' '),
  text.slice(6, 11)
]

for (let i of arr) {
  console.log(i)
}
23
Hi World Hello Human
Hi World Hi Human
hello world hello human
["Hello","World","Hello","Human"]
World

联系 math@baima.site