What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-23 00:20:50
return first letter of string javascript in uppercase
//capitalize only the first letter of the string. function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } //capitalize all words of a string. function capitalizeWords(string) { return string.repl... Add solution -
Other 2022-01-22 18:40:45
schema types
All Schema Types: required: boolean or function, if true adds a required validator for this property default: Any or function, sets a default value for the path. If the value is a function, the return value of the function is used as the default. select:... Add solution -
Other 2022-01-22 08:56:04
function to check how many times a character appears in a string
function letterCount(string, letter, caseSensitive) { var count = 0; if ( !caseSensitive) { string = string.toUpperCase(); letter = letter.toUpperCase(); } for (var i=0, l=string.length; i<string.length; i += 1) { ... Add solution -
Javascript 2022-01-22 04:46:10
regex /
Let regex; /* shorthand character classes */ regex = /d/; // matches any digit, short for [0-9] regex = /D/; // matches non-digits, short for [^0-9] regex = /S/; // matches non-white space character regex = /s/; // matches any white space character regex ... Add solution