stripLow function

String stripLow(
  1. String str, {
  2. bool keepNewLines = false,
})

Removes control characters from the string.

Removes ASCII control characters (code points 0–31 and 127). When keepNewLines is true, line feed (\n), carriage return (\r) and horizontal tab (\t) are preserved.

Example:

stripLow('hello\x00world'); // 'helloworld'
stripLow('line1\nline2', keepNewLines: true); // 'line1\nline2'

Implementation

String stripLow(String str, {bool keepNewLines = false}) =>
    _stripLow(str, keepNewLines);