camelize()

功能

将字符串转换为驼峰式写法。

语法

langx.camelize(str)

参数

  • str
    需要转换驼峰式写法的字符串

范例

Example: camelize “sky-lark” 后,b 显示转换值 skyLary 。

<!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>
   camelize("sky-lark") . result <b></b>
    <script>
    require(["skylark/finder", "skylark/langx", "skylark/datax"], function(finder, langx, datax) {
        datax.text(finder.find("b"), langx.camelize("sky-lark"));
    });
    </script>
</body>

</html>