stripLow method

String stripLow([
  1. bool keepNewLines = false
])

Removes characters with a numerical value less than 32 and 127. If keepNewLines is true, newline characters are preserved (\n and \r, hex 0xA and 0xD).

Implementation

String stripLow([bool keepNewLines = false]) {
  final chars = keepNewLines == true
      ? '\x00-\x09\x0B\x0C\x0E-\x1F\x7F'
      : '\x00-\x1F\x7F';
  return blacklist(chars);
}