简单的字符串字母大小写转换的方法

<!DOCTYPE html >
< html lang= "en" >

< head >
< meta charset= "UTF-8" >
< meta name= "viewport" content= "width=device-width, initial-scale=1.0" >
< meta http-equiv= "X-UA-Compatible" content= "ie=edge" >
< title >Document </ title >
</ head >

< body >
</ body >
< script >
var a = "abc";
var b = "EFG";

// 将字符串字母大写转化成小写的方法
var c = a. toUpperCase();
console. log( c); //ABC

// 将字符串字母小写转换成大写的方法
var d = b. toLowerCase();
console. log( d); //efg
< / script >

</ html >

猜你喜欢

转载自blog.csdn.net/weixin_41905935/article/details/80891449