JCL Help:StrToHex@AnsiString

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Converts a string of hex digit pairs to the corresponding bytes.


Pascal

 function StrToHex(const Source: string): string;
function StrToHex(const Source: AnsiString): AnsiString;


Parameters

Parameters Description
S A string of hex digit pairs to be converted.


Return Value

The string of converted bytes.


Description

The Source string is expected to contain pairs of hex digit characters ['0'..'9', 'a'..'f', 'A'..'F']. Each pair is converted to a single byte thus converting '40' to '@'. Any character not from the hex set results in an empty string. If the string length of the Source is odd then a '0' is prepended internally to make up the first byte.


About

Unit

JclAnsiStrings


Donator

Azret Botash


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