3
votes

I need to see if one string is not the same AS EMPTY STRING. Something like: string != ''; How can I achieve it in Pascal?

2

2 Answers

5
votes

The inequality operator is '<>', string <> '';.

0
votes

You can use the Length function, which will return the string length.

s:='My string';
x:=Length(s);
if( x > 1 ) then writeln('The string is not empty') 
            else writeln('The string is empty');