velocity-ui
    Preparing search index...

    Class StringUtils

    VelocityUI String Utilities Collection of common string manipulation functions

    Index

    Constructors

    Methods

    • Capitalize the first letter of a string

      Parameters

      • str: unknown

        The string to capitalize

      Returns string

      The capitalized string

    • Escape HTML special characters

      Parameters

      • str: string

        The string to escape

      Returns string

      The HTML-escaped string

    • Check if a string is empty or consists only of whitespace

      Parameters

      • str: string

        The string to check

      Returns boolean

      True if the string is empty or whitespace-only

    • Pad string on left/right

      Parameters

      • str: unknown

        The string to pad

      • length: number

        Target length after padding

      • char: string = ' '

        Character to use for padding (default: ' ')

      • side: "left" | "right" = 'right'

        Side to pad: 'left' or 'right' (default: 'right')

      Returns string

      The padded string

    • Repeat a string multiple times

      Parameters

      • str: unknown

        The string to repeat

      • times: number = 1

        Number of times to repeat (default: 1)

      Returns string

      The repeated string

    • Replace all occurrences of a substring

      Parameters

      • str: unknown

        The source string

      • search: string

        The substring to search for

      • replacement: string

        The replacement string

      Returns string

      The string with all occurrences replaced

    • Strip HTML tags from a string

      Parameters

      • str: string

        The string containing HTML

      Returns string

      The string with HTML tags removed

    • Convert string to camelCase

      Parameters

      • str: string

        The string to convert

      Returns string

      The camelCase string

    • Convert string to kebab-case

      Parameters

      • str: string

        The string to convert

      Returns string

      The kebab-case string

    • Convert string to snake_case

      Parameters

      • str: string

        The string to convert

      Returns string

      The snake_case string

    • Truncate string to a given length with ellipsis

      Parameters

      • str: unknown

        The string to truncate

      • maxLength: number = 50

        Maximum length before truncation (default: 50)

      Returns string

      The truncated string