Empty string: Difference between revisions
Content added Content deleted
(Forth) |
|||
Line 120: | Line 120: | ||
-- string is not empty |
-- string is not empty |
||
end if</lang> |
end if</lang> |
||
=={{header|Forth}}== |
|||
Strings are represented as an addr-len pair on the stack. An empty string has len 0. |
|||
<lang forth>: empty? ( str len -- ? ) nip 0= ; |
|||
s" " dup . empty? . \ 0 -1</forth> |
|||
=={{header|Go}}== |
=={{header|Go}}== |