Empty string: Difference between revisions
Content deleted Content added
Add SmallBASIC |
No edit summary |
||
Line 1,240: | Line 1,240: | ||
print "no empty" |
print "no empty" |
||
.</syntaxhighlight> |
.</syntaxhighlight> |
||
=={{header|ed}}== |
|||
ed has no concept of string, only lines. Still, one can empty (or even delete) a line. Checking for emptiness requires conditional matching with <tt>g</tt> and <tt>v</tt>. |
|||
<syntaxhighlight lang="sed"> |
|||
# Empty the string (line) |
|||
s/.*// |
|||
# Check for emptiness |
|||
g/.+/s//Not empty/ |
|||
v/Not empty/s//Empty</syntaxhighlight> |
|||
=={{header|Elena}}== |
=={{header|Elena}}== |