In JavaScript, toLowerCase() is a string method that is used to convert a string to lowercase. Because the toLowerCase() method is a method of the String object, it must be invoked through a particular instance of the String class. Syntax In JavaScript, the syntax for the toLowerCase()...
得到的字符串,"hello world", 被赋值给变量lowerStr. Javascript conststr ="HELLO WORLD";constlowerStr = str.toLowerCase();console.log(lowerStr);// Output: "hello world" 输出 注:本文由纯净天空筛选整理自amanv09大神的英文原创作品What is toLowerCase() Method in JavaScript ?。非经特殊声明,原始...
ThetoLowerCase()method in JavaScript converts all the uppercase characters in a string to lowercase characters and returns the result. The original string remains unchanged as this method returns a new string. Here's a simple example:
The function takes an array as a parameter and returns a new array with all elements of the original array uppercased. You can use thetoLowerCase()method to define a function that converts the elements of the array to lowercase.
JavaScript Ceferino IV Villareal toLowerCase() & toUpperCase() on a string return that same string, with the cases converted to either lower or upper cases: var inconsistent =“Up AnD dOwn”; console.log(inconsistent.toLowerCase()); // “up and down” Copy Syntax // toLowerCase() my...
To lowercase the first letter, we need to take the first letter in the string by using thecharAt()method then chain it totoLowerCasemethod and concat with the string by slicing the first letter. constname="JAVASCRIPT";console.log(name.charAt(0).toLowerCase()+name.slice(1));// "jAVASC...
JavaScript String toLowerCase() Method const str = "TutorialsPoint"; document.write("String str = ", str); document.write("After converting a specific character '", str.charAt(9), "' into in lowercase: "); document.write(str.charAt(9).toLowerCase()); OutputThe above progra...
If it is a string, call the toLowerCase() method, otherwise return empty string. You can also check if type variable has toLowerCase method or not. For example: We can check if toLowerCase method exists in Number class. Check datatype using typeof 1 2 3 "toLowerCase" in Number...
Javascript String转Lowercase用法及代码示例将字符串转换为小写JavaScript, 你可以使用String toLowerCase()方法。这个方法的作用正如它听起来的那样——它将字符串中的所有字符转换为小写。 例子:这里,String toLowerCase()被应用到myString变量,结果存储在lowercaseString多变的。经过这次操作后,lowercaseString将包含字符...
❮ Previous JavaScript String Reference Next ❯ Example Convert to lowercase: let text = "Hello World!"; let result = text.toLowerCase(); Try it Yourself » DescriptionThe toLowerCase() method converts a string to lowercase letters....