字符串的扩展方法

2022-03-05  本文已影响0人  卢卢2020

const  message = 'Error foo and .'

message.startsWith('Error') // 查找是否以Error开头  如上 返回true

message.endsWith('.') // 查找是否以.结尾 如上返回true

message.includes('foo') // 查找中间内容是否包含foo  返回true

上一篇 下一篇

猜你喜欢

热点阅读