JCL Help:StrStringToEscaped@AnsiString

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Converts a string to an escaped string.


Pascal

 function StrStringToEscaped(const S: string): string;
function StrStringToEscaped(const S: AnsiString): AnsiString;


Parameters

Parameters Description
const S: string The string to convert to an escaped string.


Return Value

The "escaped" string.


Description

StrStringToEscaped converts a string to an escaped string by replacing non-visual character sequences with their escape characters. For example, if a string contains the character #7 the resulting string will have the #7 character replaced with the 'a' sequence. This function is the inverse of StrEscapedToString. The function supports the following escape characters:

Character Value Constant Description
a #7 BELL Bell
b #8 BACKSPACE Backspace
f #12 FF Form Feed
n #10 LR Line Feed
r #13 CR Carrage Return
t #9 TAB Tabulator
v #11 VT Vertical Tabulator
\ N/A N/A Backslash
" N/A N/A Double quotes


All other characters whose ordinal value are smaller than Ord(' ') are escaped as a hexadecimal sequence like 'x01'. The StrEscapedToString is the "inverse" of this function.


See Also

StrEscapedToString


About

Unit

JclAnsiStrings


Donator

Robert Marquardt


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