目录

upperFirst()

功能

字符串第一个字符转换成大写。

语法

langx.upperFirst(str)

参数

范例

Example: 字符串 a b c ,第一个字符转成大写,input 显示转换值。

<!DOCTYPE html>
<html>

<head>
    <style>
    </style>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.3/require.min.js"></script>
    <script>
    require.config({
        baseUrl: "./",
        packages: [{
            name: "skylark",
            location: "../../../src/skylark"
        }, ]
    });
    </script>
</head>

<body>
    a b c <span>upperFirst</span>
    <input></input>
    <script>
    require(["skylark/finder", "skylark/langx", "skylark/datax"], function(finder, langx, datax) {
        var text = langx.upperFirst("a b c" );
        datax.val(finder.find("input"),text)
    });
    </script>
</body>

</html>