t := ReplaceRegExpr('\s', s, '');
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);
var t = new string(s.Where(c => !Char.IsWhiteSpace(c)).ToArray());
[Ch || Ch <- "This is a\tstring with\nwhite\rspaces", Ch /= 8, Ch /= 9, Ch /= 10, Ch /= 13, Ch /= 32 ].
t := strings.Map(func(r rune) rune {
if unicode.IsSpace(r) {
return -1
}
return r
}, s)
t = filter (not . isSpace) s
let t = s.replace(/\s/g,'');
String t = "";
for (char c : s.toCharArray())
if (!isWhitespace(c)) t = t + c;
String t = s.replaceAll("\\s+", "");
String t = "";
for (char c : s.toCharArray())
switch (c) {
case ' ', '\t', '\n', '\r' -> {}
default -> t = t + c;
}
String t = s.chars()
.filter(c -> !isWhitespace(c))
.mapToObj(c -> valueOf((char) c))
.collect(joining());
(defun remove-whitespace (s &aux |t|)
"Return a copy of S (a sequence) excluding all the characters space, tab, linefeed, return, and formfeed."
(setf |t|
(remove-if
(lambda (item) (find item '(#\Space #\Tab #\Linefeed #\Return #\Page)))
s))
|t|)
my $t = $s;
$t =~ s/\s*//g;
f = lambda x: x not in whitespace
t = ''.join(filter(f, s))
t = s.gsub(/[[:space:]]/, "")
let t: String = s.chars().filter(|c| !c.is_whitespace()).collect();