const message = 'Error foo and .'
message.startsWith('Error') // 查找是否以Error开头 如上 返回true
message.endsWith('.') // 查找是否以.结尾 如上返回true
message.includes('foo') // 查找中间内容是否包含foo 返回true
const message = 'Error foo and .'
message.startsWith('Error') // 查找是否以Error开头 如上 返回true
message.endsWith('.') // 查找是否以.结尾 如上返回true
message.includes('foo') // 查找中间内容是否包含foo 返回true
本文标题:字符串的扩展方法
本文链接:https://www.haomeiwen.com/subject/mhtbrrtx.html
网友评论