// ts
const hintNewLine = (text) => {
const newHint = text.replace('.', '.\n')
return newHint
}
hintNewLine('Hello everyone, I am from China. My name is Xiaoyao')
// css
white-space: pre-wrap;
// 【效果】 '.'之后的内容换行显示
4. 一串string中.之后的内容换行显示
最新推荐文章于 2024-05-19 11:30:00 发布