对于主机语言环境,如何在JavaScript中将字符串转换为小写字母?

要将字符串转换为JavaScript中的小写字母,请使用toLocaleLowerCase()方法。

示例

您可以尝试运行以下代码以了解如何使用toLocaleLowerCase()JavaScript中的方法-

<!DOCTYPE html>
<html>
   <body>
      <script>
         var a = "WELCOME!";
         document.write(a.toLocaleLowerCase());
      </script>
   </body>
</html>