开发者

Pascal comparing strings

I n开发者_JAVA技巧eed to see if one string is not the same AS EMPTY STRING. Something like: string != ''; How can I achieve it in Pascal?


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


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');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜