toLowerCase() 方法用于把字符串转换为小写。 语法 string.toLowerCase() 浏览器支持 所有主要浏览器都支持 toLowerCase() 方法 实例 实例 把字符串转换为小写: varstr="Runoob";document.write(str.toLowerCase()); 尝试一下 » JavaScript String 对象 ...
String对象允许你处理一系列字符;它用许多辅助方法包装Javascript的字符串原始数据类型。当JavaScript在字符串原语和字符串对象之间自动转换时,可以在字符串原语上调用string对象的任何辅助方法。本文主要介绍JavaScript(JS) string.toLowerCase( ) 方法。
四、字符串(String)对象及处理字符串的方法(下篇) (6) 字符串大小写转换 在JavaScript 中,使用 toLowerCase()和 toUpperCase()这两种方法来转化 字符串的大小写。其中,toLowerCase()方法将大写字符串转换为小写字符串; toUpperCase()将小写字符串转换为大写字符串。 语法: 字符串名. toLowerCase() //将大写字...
newString = string.concat(string1, string2, ..., stringX) 2、repeat()方法字符串复制指定次数 newString = string.repeat(count) 3、toLowerCase()方法用于把字符串转换为小写。 lowerString = string.toLowerCase() 4、toUpperCase()方法用于把字符串转换为大写。 upperString = string.toUpperCase() 5、...
toLowerCase()方法介绍: stringObject.toLowerCase() AI代码助手复制代码 返回值 一个新的字符串,在其中 stringObject 的所有大写字符全部被转换为了小写字符。 实例 在本例中,"Hello world!" 将以小写字母来显示: varstr="Hello World!"document.write(str.toLowerCase()) AI代码助手复制代码...
返回JavaScript String 对象参考手册(目录) 定义和用法 toLowerCase() 方法用于把字符串转换为小写。 语法 AI检测代码解析 stringObject.toLowerCase() 1. 返回值 一个新的字符串,在其中 stringObject 的所有大写字符全部被转换为了小写字符。 实例 在本例中,"Hello world!" 将以小写字母来显示: ...
String对象允许你处理一系列字符;它用许多辅助方法包装Javascript的字符串原始数据类型。当JavaScript在字符串原语和字符串对象之间自动转换时,可以在字符串原语上调用string对象的任何辅助方法。本文主要介绍JavaScript(JS) string.toLowerCase( ) 方法。 原文地址:JavaScript(JS) string.toLowerCase( ) ...
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 ...
var txt2=txt.toLowerCase(); // txt2 文本会转换为小写 尝试一下 » 字符串转为数组 字符串使用split()函数转为数组: 实例 txt="a,b,c,d,e" // String txt.split(","); // 使用逗号分隔 txt.split(" "); // 使用空格分隔 txt.split("|"); // 使用竖线分隔 ...
了解String 对象教程,请查看 JavaScript String 对象教程。String 对象属性属性描述 constructor 对创建该对象的函数的引用 length 字符串的长度 prototype 允许您向对象添加属性和方法String 对象方法方法描述 charAt() 返回在指定位置的字符。 charCodeAt() 返回在指定的位置的字符的 Unicode 编码。 concat() 连接两个...