GitHub 6219★

Check if a string contains upper case characters

JavaScript version

const containsUpperCase = (str) => str !== str.toLowerCase();

TypeScript version

const containsUpperCase = (str: string): boolean => str !== str.toLowerCase();

Examples

containsUpperCase('Hello World'); // true
containsUpperCase('hello world'); // false
Follow me on and to get more useful contents.