KotlinStringtrim

Returns a string with leading and trailing whitespace removed.

Syntax

str.trim()

Example

Enter values below to update the example in real time.

println
Hello
println("  Hello  ".trim()) // Hello