Function strCountChars

  • Counts the number of occurrences of each character in a string and returns a Map where the keys are the characters and the values are their counts.

    Parameters

    • string: string

      The string to count characters in.

    Returns Map<string, number>

    Example

    strCountChars("hello");;
    //=> Map { 'h' => 1, 'e' => 1, 'l' => 2, 'o' => 1 }

Generated using TypeDoc