Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 673 Bytes

isLowerCase.md

File metadata and controls

27 lines (18 loc) · 673 Bytes
标题 标签
isLowerCase(是否小写) string(字符串)

检查字符串是否为小写。

  • 使用 String.prototype.toLowerCase() 将给定的字符串转换为小写并将其与原始字符串进行比较。
const isLowerCase = str => str === str.toLowerCase();

调用方式:

isLowerCase('abc'); // true
isLowerCase('a3@$'); // true
isLowerCase('Ab4'); // false

应用场景

结果如下:

<iframe src="codes/javascript/html/isLowerCase.html"></iframe>