@nevware21/ts-utils
    Preparing search index...

    Function strCapitalizeWords

    • Convert the provided value to Capitalized Words, where each detected word starts with an uppercase character and the remaining characters of that word are lowercased.

      A word is a run of any characters other than whitespace, punctuation and symbols (including non-ASCII letters), so existing separators (spaces, punctuation, _, and -) are retained. The separators are the punctuation and symbols of ASCII and Latin-1 (except ª²³µ¹º¼½¾) and of the General Punctuation (except the zero width non-joiner and joiner), Currency Symbols, Arrows to Miscellaneous Symbols and Arrows (except Enclosed Alphanumerics, eg. Ⓐ and ①, and the Dingbat numbers, eg. ❶) and CJK Symbols and Punctuation blocks, so the emoji of these blocks (eg. ©, ❤, ⭐ and ✅) are separators. All other characters (eg. supplementary plane emoji such as 😀, Letterlike Symbols such as ™, and fullwidth or non-Latin punctuation) are part of a word. Words are only split at separators, so camelCase boundaries are not retained ("fooBarBaz" becomes "Foobarbaz"), use strCamelCase or strKebabCase with strLetterCase to retain them. If the value is not a string it will be converted.

      Type Parameters

      • T

      Parameters

      • value: T

        The value to be converted to capitalized words

      Returns string

      The Capitalized Words version of the provided value

      0.14.0

      strCapitalizeWords(null);                      // "Null"
      strCapitalizeWords(undefined); // "Undefined"
      strCapitalizeWords("hello darkness"); // "Hello Darkness"
      strCapitalizeWords("hELLo dARKness"); // "Hello Darkness"
      strCapitalizeWords("hello_darkness"); // "Hello_Darkness"
      strCapitalizeWords("hello-darkness"); // "Hello-Darkness"
      strCapitalizeWords("hello darkness, my old friend."); // "Hello Darkness, My Old Friend."
      strCapitalizeWords("café crème"); // "Café Crème"
      strCapitalizeWords("fooBarBaz"); // "Foobarbaz"
      strLetterCase(strKebabCase("fooBarBaz")); // "Foo-Bar-Baz"