一、总结

一句话总结:

js字符串大小写转换方法有toLowerCase()和toUpperCase(),就是分别将字符串转化成小写和大写
toLowerCase()
作用:将字符串转化成小写
参数:无
返回值:转换成小写的字符串

toUpperCase()


console.log('ABc'.toLowerCase());
console.log('ABc'.toUpperCase());

 

 

 

二、字符串大小写转换

博客对应课程的视频位置:

 

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>toLowerCase()</title>
 6 </head>
 7 <body>
 8 <!--
 9 toLowerCase()
10 作用:将字符串转化成小写
11 参数:无
12 返回值:转换成小写的字符串
13 
14 toUpperCase()
15 
16 
17 -->
18 <script>
19     console.log('ABc'.toLowerCase());
20     console.log('ABc'.toUpperCase());
21 </script>
22 </body>
23 </html>

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2021-12-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-14
  • 2022-02-04
  • 2022-12-23
  • 2022-03-10
  • 2022-01-15
  • 2022-12-23
相关资源
相似解决方案