View Problem

Make a string uppercase

Transform "Space Monkey" into "SPACE MONKEY"
ExpandDiskEdit
ruby
uppper = text.upcase
ExpandDiskEdit
java
String upper = text.toUpperCase();
DiskEdit
perl
print uc "Space Monkey"
DiskEdit
groovy
println "Space Monkey".toUpperCase()
DiskEdit
groovy
def lower = 'Space Monkey'
assert lower.toUpperCase() == 'SPACE MONKEY'
DiskEdit
groovy fgdh
ExpandDiskEdit
scala
println("Space Monkey".toUpperCase)
DiskEdit
python
"Space Monkey".upper()
ExpandDiskEdit
cpp C++/CLI .NET 2.0
String(L"Space Monkey").ToUpper();
ExpandDiskEdit
cpp
std::string s = "Space Monkey";
std::transform(s.begin(), s.end(), s.begin(), std::toupper);
ExpandDiskEdit
cpp
std::string s = "Space Monkey";
boost::to_upper(s);
ExpandDiskEdit
fsharp
printfn "%s" ("Space Monkey".ToUpper())
ExpandDiskEdit
fsharp
printfn "%s" (String.uppercase "Space Monkey")
ExpandDiskEdit
erlang
io:format("~s~n", [string:to_upper("Space Monkey")]).
DiskEdit
ocaml
String.uppercase "Space Monkey";;
ExpandDiskEdit
csharp
string output = "Space Monkey"

System.Console.WriteLine(output.ToUpper())
ExpandDiskEdit
php
echo strtoupper("Space Monkey");
DiskEdit
haskell "
toUpperCase oldstring converted = if oldstring == ""
then converted
else toUpperCase (tail(oldstring)) (converted ++ [Char.toUpper(head(oldstring))])

toUpperCase "Space Monkey" ""
DiskEdit
haskell
toUpperCase = map Char.toUpper

toUpperCase "Space Monkey"
DiskEdit
clojure
(.toUpperCase "Space Monkey")
ExpandDiskEdit
fantom
s := "Space Monkey".localeUpper
ExpandDiskEdit
go
strings.ToUpper("Space Monkey")

Submit a new solution for ruby, java, perl, groovy ...