Empty string
This seems like a silly question. But a question i've been having trouble figuring out...
How do i determine if a string is empty? Code:
if(equali(string, "") ) // throws warningsCode:
if(sizeof string < 2) // Throws 3 warningsCode:
if(string[0]) // simply doesn't workCode:
if(charsmax(string) < 2) // Throws errors & warningsCode:
formatex(string, charsmax(string), "[page]") |
Re: Empty string
You can use strlen(). Or maybe check if szString[0] = EOS.
|
Re: Empty string
PHP Code:
PHP Code:
|
Re: Empty string
Quote:
|
Re: Empty string
EOS = '^0' = 0
|
Re: Empty string
Quote:
Code:
if(string[0] == EOS) |
Re: Empty string
Just for better understanding, EOS simply means end of string.
|
Re: Empty string
Quote:
|
Re: Empty string
Quote:
[php]if(pm_sound[0]) client_cmd(reciever, "speak ^"sound/%s^"", pm_sound)[/pm] I figured that out after <VeCo>'s post and some fooling around. |
Re: Empty string
Quote:
|
| All times are GMT -4. The time now is 15:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.