Login
|
Signup
langref.org
-
ruby
,
csharp
,
erlang
, and
fantom
add..
all
clojure
cpp
fsharp
go
groovy
haskell
java
ocaml
perl
php
python
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Lists
Declaration
Define a static list
Define the list
[One, Two, Three, Four, Five]
ruby
list = ['One', 'Two', 'Three', 'Four', 'Five']
list = ['One', 'Two', 'Three', 'Four', 'Five']
p list
ruby
list = %w(One Two Three Four Five)
list = %w(One Two Three Four Five)
p list
csharp
IList<string> list = new string[]{"One","Two","Three","Four","Five"};
IList<string> list = new string[]{"One","Two","Three","Four","Five"};
erlang
List = [one, two, three, four, five],
-module(statlist).
-export([start/0]).
start() ->
List = [one, two, three, four, five],
io:format("~B~n", [length(List)]).
erlang
List = ['One', 'Two', 'Three', 'Four', 'Five'],
-module(statlist).
-export([start/0]).
start() ->
List = ['One', 'Two', 'Three', 'Four', 'Five'],
io:format("~B~n", [length(List)]).
fantom
list := ["One", "Two", "Three", "Four", "Five"]
class SolutionXX
{
Void main()
{
list := ["One", "Two", "Three", "Four", "Five"]
}
}
Submit a new solution for
ruby
,
csharp
,
erlang
, or
fantom
There are 30 other solutions in
additional
languages (
clojure
,
cpp
,
fsharp
,
go
...)