Function strSplitAndTrim

  • Splits a string by a specified delimiter and trims each resulting substring. Optionally, it can also remove empty lines.

    Parameters

    • string: string

      The string to be split and trimmed.

    • delimiter: string

      The delimiter to split the string by.

    • removeEmptyLines: boolean = false

      Optional parameter. If true, removes empty lines from the resulting array. Default is false.

    Returns string[]

    Example

    strSplitAndTrim("  Hello ;  world ; ". ";", true;
    //=> ["Hello", "world"]
    strSplitAndTrim(" Hello ; world ; ". ";", false;
    //=> ["Hello", "world", ""]

Generated using TypeDoc