• Returns a string that trimmed from the given string

    Parameters

    • Optionaltext: null | string

      the string to trim

    • OptionalemptyAsNull: boolean

      whether to return null if the trimmed result is empty

    Returns string | undefined | null

    the trimmed string value from the given string

    trim("foobar", true);    // 'foobar'