StringLineExtensions extension

Extensions for line-based string operations (line breaks, BOM, indent).

on

Methods

normalizeLineBreaks([String target = '\n']) String

Available on String, provided by the StringLineExtensions extension

Normalizes line breaks to target (default \n).
splitIntoLines() List<String>

Available on String, provided by the StringLineExtensions extension

Splits this string into lines, normalizing CRLF/CR/LF to a single newline first.
stripBom() String

Available on String, provided by the StringLineExtensions extension

Removes the UTF-8 BOM (U+FEFF) from the start of this string if present.