Function foldnl

  • wrap string with new lines to fit in specified width

    Parameters

    • sIn: string

      string

    • n: number

      width

    • separator: string = "\r\n"

      line separator

    Returns string

    wrapped string with new lines

    Description

    This function wrap a string with new lines to fit in specified width.

    Example

    foldnl("1234567890", 6)
    ->
    123456
    7890