toLowerCase() 方法用于把字符串转换为小写。 语法 string.toLowerCase() 浏览器支持 所有主要浏览器都支持 toLowerCase() 方法 实例 实例 把字符串转换为小写: varstr="Runoob";document.write(str.toLowerCase()); 尝试一下 » JavaScript String 对象 ...
String对象允许你处理一系列字符;它用许多辅助方法包装Javascript的字符串原始数据类型。当JavaScript在字符串原语和字符串对象之间自动转换时,可以在字符串原语上调用string对象的任何辅助方法。本文主要介绍JavaScript(JS) string.toLowerCase( ) 方法。 原文地址:JavaScript(JS) string.toLowerCase( ) ...
四、字符串(String)对象及处理字符串的方法(下篇) (6) 字符串大小写转换 在JavaScript 中,使用 toLowerCase()和 toUpperCase()这两种方法来转化 字符串的大小写。其中,toLowerCase()方法将大写字符串转换为小写字符串; toUpperCase()将小写字符串转换为大写字符串。 语法: 字符串名. toLowerCase() //将大写字...
RegExp - 您可以使用针对正则表达式的语言支持,也可以显式访问它们 String – 包括 concat、indexOf、lastIndexOf、substr、split、splice、search、replace、toUpperCase、toLowerCase 等 还提供了全局可用的函数,如 parseInt、parseFloat、isNaN、decodeURI、encodeURI。 Print 函数 通过Print 函数可以在创建脚本时输出调...
String 对象方法 1、concat()方法用于连接两个或多个字符串。 newString = string.concat(string1, string2, ..., stringX) 2、repeat()方法字符串复制指定次数 newString = string.repeat(count) 3、toLowerCase()方法用于把字符串转换为小写。
了解String 对象教程,请查看 JavaScript String 对象教程。String 对象属性属性描述 constructor 对创建该对象的函数的引用 length 字符串的长度 prototype 允许您向对象添加属性和方法String 对象方法方法描述 charAt() 返回在指定位置的字符。 charCodeAt() 返回在指定的位置的字符的 Unicode 编码。 concat() 连接两个...
The toLowerCase() method returns the string converted to lowercase. Example const message = "JAVASCRIPT IS FUN"; // convert message to lowercase const lowerMessage = message.toLowerCase(); console.log(lowerMessage); // Output: javascript is fun Run Code toLowerCase() Syntax The syntax ...
toLowerCase() 方法用于把字符串转换为小写。 语法 stringObject.toLowerCase() 1. 返回值 一个新的字符串,在其中 stringObject 的所有大写字符全部被转换为了小写字符。 实例 在本例中,"Hello world!" 将以小写字母来显示: var str="Hello World!" document...
split(separator:string|RegExp, limit?:number):string[];// 通过分离字符串成字串,将字符串对象分割成字符串数组。 大小写转换(4) toLocaleLowerCase(locales?:string|string[]):string;// 根据当前区域设置,将符串中的字符转换成小写。对于大多数语言来说,toLowerCase的返回值是一致的。toLocaleUpperCase(locales...
letresult = text.toLowerCase(); Try it Yourself » Description ThetoLowerCase()method converts a string to lowercase letters. ThetoLowerCase()method does not change the original string. See Also: The toUpperCase() Method The toLocaleLowerCase() Method ...