Anonymous user
Strip whitespace from a string/Top and tail: Difference between revisions
Strip whitespace from a string/Top and tail (view source)
Revision as of 20:12, 17 April 2021
, 3 years agoChanged output. Added output.
m (→{{header|Phix}}: added syntax colouring the hard way, phix/basics) |
(Changed output. Added output.) |
||
Line 1,661:
<lang nim>import strutils
let s = "
echo "
echo("*** Stripped of leading spaces ***")
echo "'", s.strip(trailing = false), "'"▼
echo "
echo("*** Stripped of trailing spaces ***")
echo "'", s.strip(), "'"</lang>▼
echo("*** Stripped of leading and trailing spaces ***")
</lang>
{{out}}
<pre>“
String with spaces
”
*** Stripped of leading spaces ***
“String with spaces
”
*** Stripped of trailing spaces ***
“
String with spaces”
*** Stripped of leading and trailing spaces ***
“String with spaces”</pre>
=={{header|Oberon-2}}==
|