字符串的扩展方法

const  message = 'Error foo and .'

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

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

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

你可能感兴趣的:(字符串的扩展方法)