Home

function: startCase


startCase(string: string): string

Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).

Example(s):

startCase('--foo-bar--')
// => 'Foo Bar'

startCase('fooBar')
// => 'Foo Bar'

startCase('__FOO_BAR__')
// => 'FOO BAR'

Params:

Name Type Attribute Description
string The string to convert.

Returns:

string

  {
    "comment": "/**\r\n * Converts `string` to\r\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\r\n *\r\n * @since 3.1.0\r\n * @category String\r\n * @param {string} [string=''] The string to convert.\r\n * @returns {string} Returns the start cased string.\r\n * @see camelCase, lowerCase, kebabCase, snakeCase, upperCase, upperFirst\r\n * @example\r\n *\r\n * startCase('--foo-bar--')\r\n * // => 'Foo Bar'\r\n *\r\n * startCase('fooBar')\r\n * // => 'Foo Bar'\r\n *\r\n * startCase('__FOO_BAR__')\r\n * // => 'FOO BAR'\r\n */",
    "meta": {
        "range": [
            602,
            776
        ],
        "filename": "startCase.js",
        "lineno": 24,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100008750",
            "name": "startCase",
            "type": "ArrowFunctionExpression"
        },
        "vars": {
            "": null
        }
    },
    "description": "Converts `string` to\r[start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).",
    "since": "3.1.0",
    "tags": [
        {
            "originalTitle": "category",
            "title": "category",
            "text": "String",
            "value": "String"
        }
    ],
    "params": [
        {
            "type": {
                "names": [
                    "string"
                ]
            },
            "optional": true,
            "defaultvalue": "''",
            "description": "The string to convert.",
            "name": "string"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "string"
                ]
            },
            "description": "Returns the start cased string."
        }
    ],
    "see": [
        "camelCase, lowerCase, kebabCase, snakeCase, upperCase, upperFirst"
    ],
    "examples": [
        "startCase('--foo-bar--')\r// => 'Foo Bar'\r\rstartCase('fooBar')\r// => 'Foo Bar'\r\rstartCase('__FOO_BAR__')\r// => 'FOO BAR'"
    ],
    "name": "startCase",
    "longname": "startCase",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R000796",
    "___s": true,
    "filepath": "startCase.js"
}