JCL Help:StrReplaceButChars@AnsiString@TSysCharSet@AnsiChar

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Replaces all occurrences of one or more characters with another character.


Pascal

 function StrReplaceButChars(const S: string; const Chars: TCharValidator; Replace: Char): string; overload;
function StrReplaceButChars(const S: string; const Chars: array of Char; Replace: Char): string; overload;
function StrReplaceButChars(const S: AnsiString; const Chars: TSysCharSet; Replace: AnsiChar): AnsiString;


Parameters

Parameters Description
const S: string The string in which to replace characters.
const Chars: TCharValidator The characters which should not be replaced.
Replace: Char The character to use as replacement.


Return Value

The string with all replacements performed.


Description

StrReplaceButChars replaces all occurrences of characters which are not within the specified search character(s) with the supplied replace character. Note that the replacement is case-sensitive.


About

Unit

JclAnsiStrings


Donator

Anonymous


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page