Remove spaces at both ends
Remove the spaces before and after a name. A space between two words stays in place. These examples use ordinary spaces.
strip
Simple example
Trim the single letter.
Start' a '
Resulta
function main()
println(strip(" a "))
end
main()
a
Advertisements
Everyday examples
Remove the extra spaces copied around a ticket number.
Start' B12 '
ResultB12
function main()
println(strip(" B12 "))
end
main()
B12
Clean up the outside spaces on a shelf label.
Start' Red Apples '
ResultRed Apples
function main()
println(strip(" Red Apples "))
end
main()
Red Apples
Clean up a name copied from a signup sheet.
Start' Ana '
ResultAna
function main()
println(strip(" Ana "))
end
main()
Ana