Can someone please give me a brief but precise example of how to use the IsNullOrEmpty() function within a procedure or function?
This is basically what I'm trying to achieve:
If IsNullOrWhiteSpace(Expression):= False Then //If the expression contains valid data...
ShowMessage('String is legitimate.')
Else //If the expression does not contain valid data...
ShowMessage('String is bad!')
End If
This should be elementary and simple but I just can't get it to work. The only documentation I can find for the function just shows its declaration in the TStringHelper class, which of course, is useless to me at the moment.
class function TStringHelper.IsNullOrEmpty(const AValue: string): Boolean;
begin
Result:=system.Length(AValue)=0;
end;
class function TStringHelper.IsNullOrWhiteSpace(const AValue: string): Boolean;
begin
Result:=system.Length(SysUtils.Trim(AValue))=0;
end;
Is there any documentation anywhere which shows basic examples of how to use each function in Object Pascal? I remember in the 1990s we could get books 2" to 3" thick that were dedicated to actually explaining each function (divided by library/component) for C, C++, FoxPro, assembler, etc.