Home  >  Article  >  Web Front-end  >  How to convert case in javascript

How to convert case in javascript

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-07-20 10:33:4527512browse

js letter case conversion method: 1. Convert to uppercase, toUpperCase(), syntax format "Object.toUpperCase()"; 2. Convert to lowercase, toLowerCase(), syntax format "Object.toLowerCase() )".

How to convert case in javascript

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

js letter case conversion method:

1. Convert to uppercase: toUpperCase()

2. Convert to lowercase: toLowerCase()

3 , Example:

    (1)var a="aBcD";
            a=a.toUpperCase();
            alert(a);
            提示出来的就是 ABCD
    (2)var a="aBcD";
            a=a.toLowerCase();
            alert(a);
            提示出来的就是 abcd

[Recommended learning: javascript advanced tutorial]

The above is the detailed content of How to convert case in javascript. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn