Use utf8-friendly space symbols chop operation in trim()

This commit is contained in:
eleksir
2022-04-03 16:36:56 +03:00
parent 5e5613ff82
commit 8d4bf1abd9

View File

@@ -23,13 +23,8 @@ sub trim {
return $str;
}
while (substr ($str, 0, 1) =~ /^\s$/xms) {
$str = substr $str, 1;
}
while (substr ($str, -1, 1) =~ /^\s$/xms) {
chop $str;
}
$str =~ s/^\s+//;
$str =~ s/\s+$//;
return $str;
}