Sign in Join
FPDoc Onlineexperiment

SpecialCharsToSpaces function

In unit LazStringUtils

Converts occurrences of special characters to spaces.

Declaration

pascal
function SpecialCharsToSpaces(const s: string; FixUTF8: Boolean)
: string

Arguments

s

String examined and converted in the routine.

FixUTF8True when invalid UTF-8 codepoints are repaired in the string.

Function result

String after converting special characters.

Description

Converts special characters (#0..#31, #127) to a Space character. Converts line breaks to a single Space character (#32). Trims leading and trailing Spaces. Calls UTF8FixBroken when FixUTF8 is True.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.