JCL Help:PCharOrNil

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Explicit replacement for PChar typecast.


Pascal

 function PCharOrNil(const S: string): PChar;


Parameters

Parameters Description
const S: string The string for which to return a PChar.


Return Value

If the specified string is empty the funtion returns nil, otherwise it returns a pointer to the first character of the string.


Description

PCharOrNil returns a pointer to the first character of the specified string or nil if the string is empty. This is identical to simply typecasting to PChar except that this function makes the behaviour of the typecast explicit (and independent of the compiler).


See Also

PWideCharOrNil


About

Unit

JclSysUtils


Donator

Petr Vones


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