
javascript如何利用函数实现大写字母转换成小写字母(小写字母转换成大写字母),下面web建站小编给大家详细介绍一下实现代码!
利用toUpperCase()方法把字符串转换为大写
let str = 'Hello web'
console.log('转换:', str.toUpperCase())
//转换: HELLO WEB
利用toLocaleUpperCase()方法把字符串转换为大写
let str = 'Hello web'
console.log('转换:', str.toLocaleUpperCase())
转换: HELLO WEB
利用toLowerCase()方法把字符串转换为小写
let str = 'Hello web'
console.log('转换:', str.toLowerCase())
转换: hello web
利用toLocaleLowerCase()方法把字符串转换为小写
let str = 'Hello web'
console.log('转换:', str.toLocaleLowerCase())
转换: hello web
标签: toLocaleLowerCase, toLocaleUpperCase, toLowerCase, toUpperCase
上面是“js大小写字母互相转换”的全面内容,想了解更多关于 js 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_2720.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

一个提供全球经济数据和分析的平台——世界财富与收入数据库
js利用正则匹配方法获取url参数
Ainee:一款AI笔记工具,包括实时音频、文本、视频、PDF等
PhotoDoodle:AI图像编辑新突破,一键将照片转化为艺术作品
SRT字幕编辑器
three.js云彩雷电效果