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

m
→‎{{header|Phix}}: retracted the 4 spaces thing... will revisit
m (→‎{{header|Phix}}: made p2js compatible, with note)
m (→‎{{header|Phix}}: retracted the 4 spaces thing... will revisit)
Line 2,026:
<span style="color: #0000FF;">?</span><span style="color: #7060A8;">trim</span><span style="color: #0000FF;">(</span><span style="color: #000000;">s</span><span style="color: #0000FF;">)</span>
<!--</lang>-->
<!--
<small>Note that JavaScript deems tab characters as something from the dark ages, especially in strings, and tries valiantly to completely mishandle them in every way it possibly can, for instance the JavaScript statement <code>f("&nbsp;&nbsp;&nbsp;&nbsp;","\t","\x09");</code> <X!--(&nbsp; used there for output, but I mean the code as it actually looks)--X> leads to f() to receiving three identical parameters of 4 spaces each. The transpiler therefore prohibits tabs in strings but can however fudge a single tab character as 0X9 (ie no quotes) in the JavaScript source code it outputs, and things are fine as long as we forcibly construct any tab-containing strings as per the "&" above, and/or similar subscripting/substitution.</small>
-->
{{out}}
<pre>
7,794

edits