Login
|
Signup
langref.org
-
fsharp
and
clojure
add..
all
cpp
csharp
erlang
fantom
go
groovy
haskell
java
ocaml
perl
php
python
ruby
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Strings
Manipulation
Remove leading and trailing whitespace from a string
Given the string
" hello "
return the string
"hello"
.
fsharp
let s = " hello "
let trimmed = s.Trim()
#light
open System
let s = " hello "
let trimmed = s.Trim()
printfn "|%s|%s|" s trimmed
fsharp
let trimmed = " hello ".Trim()
#light
open System
let trimmed = " hello ".Trim()
printfn "|%s|" trimmed
clojure
(use 'clojure.contrib.str-utils2)
(trim " hello ")
(use 'clojure.contrib.str-utils2)
(trim " hello ")
clojure
1.3
(clojure.string/trim " hello ")
(clojure.string/trim " hello ")
clojure
(.trim " hello ")
(.trim " hello ")
Submit a new solution for
fsharp
or
clojure
There are 17 other solutions in
additional
languages (
cpp
,
csharp
,
erlang
,
fantom
...)