Hiyve Components - v1.0.0
    Preparing search index...
    • Extract initials from a name or userId.

      Parameters

      • name: string

        The name or userId to extract initials from

      Returns string

      1-2 character initials in uppercase

      • For names with spaces, dashes, or underscores: uses first letter of first two parts
      • For single words: uses first two characters
      • For empty strings: returns '?'
      getInitials('John Doe')    // 'JD'
      getInitials('jane_smith') // 'JS'
      getInitials('admin') // 'AD'
      getInitials('') // '?'