Merge pull request #506 from kriadmin/isUpperCase
[FEATURE] isUpperCase isLowerCase
This commit is contained in:
15
snippets/isLowerCase.md
Normal file
15
snippets/isLowerCase.md
Normal file
@ -0,0 +1,15 @@
|
||||
### isLowerCase
|
||||
|
||||
Checks if a string is lower case.
|
||||
|
||||
Convert the given string to lower case, using `String.toLowerCase()` and compare it to the original.
|
||||
|
||||
``` js
|
||||
const isLowerCase = str => str === str.toLowerCase();
|
||||
```
|
||||
|
||||
```js
|
||||
isLowerCase('abc'); // true
|
||||
isLowerCase('a3@$'); // true
|
||||
isLowerCase('Ab4'); // false
|
||||
```
|
||||
16
snippets/isUpperCase.md
Normal file
16
snippets/isUpperCase.md
Normal file
@ -0,0 +1,16 @@
|
||||
### isUpperCase
|
||||
|
||||
Checks if a string is upper case.
|
||||
|
||||
Convert the given string to upper case, using `String.toUpperCase()` and compare it to the original.
|
||||
|
||||
|
||||
``` js
|
||||
const isUpperCase = str => str === str.toUpperCase();
|
||||
```
|
||||
|
||||
``` js
|
||||
isUpperCase('ABC'); // true
|
||||
isLowerCase('A3@$'); // true
|
||||
isLowerCase('aB4'); // false
|
||||
```
|
||||
Reference in New Issue
Block a user