Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript vérifier si une chaine de carctère commence par une majuscule

/* Test if a character is uppercase by converting it to lowercase 
 *   and comparing that with the original. 
 * If they are different, the original was uppercase. 
 * If they are the same, the original was either a lowercase character
 *   or a character that doesn't have uppercase and lowercase 
 *   versions (e.g. a number or punctuation mark).
*/
function isUpperCase(char)
{
  // 'char' is a string containing a single character
  return char !== char.toLowerCase();
}
Source by stackoverrun.com #
 
PREVIOUS NEXT
Tagged: #javascript #si #une #chaine #de #commence #par #une #majuscule
ADD COMMENT
Topic
Name
7+3 =