Strip whitespace from a string/Top and tail: Difference between revisions
Strip whitespace from a string/Top and tail (view source)
Revision as of 04:06, 20 July 2011
, 12 years agoadded OpenEdge solution
(Added Nemerle) |
(added OpenEdge solution) |
||
Line 334:
# rtrim s ;;
- : string = " \t \r \n String with spaces"</pre>
=={{header|OpenEdge/Progress}}==
<lang progress>DEF VAR cc AS CHAR INIT " string with spaces ".
MESSAGE
"|" + LEFT-TRIM( cc ) + "|" SKIP
"|" + RIGHT-TRIM( cc ) + "|" SKIP
"|" + TRIM( cc ) + "|"
VIEW-AS ALERT-BOX.</lang>
Output:
<pre>
---------------------------
Message
---------------------------
|string with spaces |
| string with spaces|
|string with spaces|
---------------------------
OK
---------------------------
</pre>
=={{header|Perl}}==
|