Pangram checker: Difference between revisions
Content deleted Content added
→{{header|F Sharp|F#}}: Add Erlang. |
|||
Line 562:
-import(string, [to_upper/1]).
contains(List, Item) ->
is_pangram(S) ->▼
any( fun(X) -> X == Item end, List ).
Alphabet = seq(hd("A"), hd("Z")),
UpperString = to_upper(String),
all(fun(X) -> any(fun(Y) -> X == Y end, to_upper(S)) end, Alphabet).</lang>▼
all( fun(Letter) -> contains(UpperString, Letter) end, Alphabet).</lang>
or, more concisely,
<lang Erlang>-module(pangram).
-export([is_pangram/1]).
▲is_pangram(S) -> lists:all( fun(
lists:seq( hd("A"), hd("Z"))).</lang>
=={{header|F Sharp|F#}}==
|