Question : remove white spaces
Answered by : muhammad-khizar-hayat
"hello world".replace(/\s/g, "");
Source : https://stackoverflow.com/questions/10800355/remove-whitespaces-inside-a-string-in-javascript | Last Update : Sun, 24 Oct 21
Question : Deleting all white spaces in a string
Answered by : rashad
.replaceAll(/\s/g,'')
Source : https://stackoverflow.com/questions/6623231/remove-all-white-spaces-from-text | Last Update : Sun, 28 Nov 21
Question : Remove whitespace from str
Answered by : outstanding-opossum-74rx61vwtnk0
name = name.strip()
Source : | Last Update : Fri, 22 Apr 22
Question : remove whitespaces
Answered by : akash-kumar-h078bu9hbq9s
//Extenion function
fun String.removeWhitespaces() = replace(" ", "")
// Uses
var str = "This is an example text".removeWhitespaces()
println(str)
Source : https://stackoverflow.com/questions/60028103/how-to-remove-all-the-whitespaces-from-a-string-in-kotlin | Last Update : Wed, 04 Aug 21
Question : Remove White Space At Sides
Answered by : eric-tam
$x = " abc ";
print(trim($x));
There are three versions of trim().
trim(): trims white space on both ends
rtrim(): trims white space on the right end
ltrim(): trims white space on the left end
Note that trim() does not remove white space in the middle of the string.
Source : | Last Update : Sun, 10 Jul 22