Strip whitespace from a string/Top and tail: Difference between revisions

no edit summary
(easylang)
No edit summary
Line 221:
+ string_trim(" foobar "), newline)) FI
)</syntaxhighlight>
 
=={{header|Amazing Hopper!}}==
 
<p>Amazing Hopper! Flavour "Jambo".</p>
<syntaxhighlight lang="amazing_hopper">
#include <jambo.h>
 
Main
 
Set stack 25
c = "\t\t\n \n Message to triming\t\n \t"
Printnl ("Original Message: [", c,"]")
Set '"\n\n\UL\ENFNatural syntax:\n\n"', then bold off, and underline off
Set '"Right trim: [", c', Do right trim; then set '"]"'
Set '"\nLeft trim: [", c', Do left trim; Set '"]"'
Set '"\nAll trim: [", c', Do trim, now set '"]"' and print with newline
Underline( Bold( "\n\nFormal syntax:\n\n" ))
Printnl ( "Right trim: [", Rtrim(c),\
"]\nLeft trim: [", Ltrim(c),\
"]\nAll trim: [",Trim(c),"]\n" )
End
</syntaxhighlight>
{{out}}
<pre>
Original Message: [
Message to triming
]
 
 
Natural syntax:
 
Right trim: [
Message to triming]
Left trim: [Message to triming
]
All trim: [Message to triming]
 
 
Formal syntax:
 
Right trim: [
Message to triming]
Left trim: [Message to triming
]
All trim: [Message to triming]
 
</pre>
 
=={{header|AppleScript}}==
543

edits