Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
[Ch || Ch <- "This is a\tstring with\nwhite\rspaces", Ch /= 8, Ch /= 9, Ch /= 10, Ch /= 13, Ch /= 32 ].
let t = s.replace(/\s/g,'');
String t = s.replaceAll("\\s+", "");
String t = "";
for (char c : s.toCharArray())
switch (c) {
case ' ', '\t', '\n', '\r' -> {}
default -> t = t + c;
}
SetLength(t, Length(s));
i := 0;
for Ch in S do
if (Ch > #32) then
begin
Inc(i);
t[i] := Ch;
end;
SetLength(t, i);
my $t = $s;
$t =~ s/\s*//g;
t = ''.join(s.split())
t = s.gsub(/\s/, "")
t = s.gsub(/[[:space:]]/, "")
let t: String = s.chars().filter(|c| !c.is_whitespace()).collect();