[fpc-pascal] Empty string

Damien Gerard milipili at shikami.org
Mon Mar 3 17:16:18 CET 2008


In any programs, a lot of tests on empty strings are made.
The following made the work :
if Length(s) <> 0 then ...
or
if s <> '' then ...

In a lot of cases, the real length is no needed, just to know if the  
string is empty or not.
I am mainly using UTF8String so strings with leading zero.
Just with the first char we can know if the string is empty or not.

Is there a function of this kind that I don't know already exist ?
Would it be possible to implement such a function (may be a stupid  
idea for an unknown reason) ?
Can this function be directly done in FPC ?

Regards.


--
Damien Gerard
milipili at shikami.org

"Intelligence is 10 million rules."
    -- Douglas Lenat








More information about the fpc-pascal mailing list