Empty string: Difference between revisions

Line 803:
if length(s) = 0 then ... /* To test whether a string is empty */
if length(s) > 0 then ... /* to test for a non-empty string */
</lang>
 
=={{header|Prolog}}==
{{works with|SWI-Prolog|7}}
<lang prolog>assign_empty_string(Variable) :- Variable = "".
 
is_empty_string(String) :- String == "".
not_empty_string(String) :- String \== "".
</lang>