Answers for "how to remove whitespaces from a string"

10

how to remove all whitespace from string java

st = st.replaceAll("\\s+","")
Posted by: Guest on April-11-2020
0

remove whitespaces

//Extenion function
fun String.removeWhitespaces() = replace(" ", "")

// Uses
var str = "This is an example text".removeWhitespaces()

println(str)
Posted by: Guest on July-28-2021

Code answers related to "how to remove whitespaces from a string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language