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

K
(K)
Line 1,437:
julia> strip(s)
"String with spaces"</syntaxhighlight>
 
=={{header|K}}==
<syntaxhighlight lang=K>dlb: {((" "<x)?1)_x}
dtb: {(-(|" "<x)?1)_x}
 
dlb " this is a test "
"this is a test "
dtb " this is a test "
" this is a test"
dtb dlb " this is a test "
"this is a test"
dtb dlb "this is a test"
"this is a test"</syntaxhighlight>
 
tested with ngn/k
 
=={{header|Kotlin}}==
6,951

edits