Open In App

Fabric.js camelize() Method

Last Updated : 18 Jan, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

The camelize() method used to camelize a specified string.

Syntax:

camelize(string)

Parameters: This method accepts a parameter as mentioned above and described below:

  • string: This parameter holds the string to camelize.

Return Value: This method returns the camelized version of the string.

Example 1:

JavaScript
<!DOCTYPE html>
<html>

<head>
    <!-- Loading the FabricJS library -->
    <script src=
"https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.6.2/fabric.min.js">
    </script>
</head>

<body>
    <script type="text/javascript">
        console.log(fabric.util.string.camelize("a-ab-abc"));
    </script>
</body>

</html>

Output:

aAbAbc

Example 2:

JavaScript
<!DOCTYPE html>
<html>

<head>
    <!-- Loading the FabricJS library -->
    <script src=
"https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.6.2/fabric.min.js">
    </script>
</head>

<body>
    <script type="text/javascript">
        console.log(fabric.util.string.camelize("geeks-for-geeks"));
    </script>
</body>

</html>

Output:

geeksForGeeks
Reference: http://fabricjs.com/docs/fabric.util.string.html#.camelize

Next Article

Similar Reads