View Problem

Remove leading and trailing whitespace from a string

Given the string "  hello    " return the string "hello".
ExpandDiskEdit
csharp
string str = " hello ";
str = str.Trim();
Console.WriteLine(str);
DiskEdit
clojure
(use 'clojure.contrib.str-utils2)
(trim " hello ")
DiskEdit
clojure 1.3
(clojure.string/trim " hello ")
DiskEdit
clojure
(.trim " hello ")
ExpandDiskEdit
cpp C++/CLI .NET 2.0
String^ s = " hello "; String^ trimmed = s->Trim();
ExpandDiskEdit
go
s := strings.TrimSpace(" hello ")

Submit a new solution for csharp, clojure, cpp, or go
There are 16 other solutions in additional languages (erlang, fantom, fsharp, groovy ...)