Jump to content

Pangram checker: Difference between revisions

Line 1,411:
is_pangram(String) ->
ordsets:is_subset(lists:seq($a, $z), ordsets:from_list(string:to_lower(String))).</lang>
 
=={{header|Excel}}==
===LAMBDA===
 
With the following lambda bound to the name ISPANGRAM in the Excel Workbook Name Manager:
 
(See [https://www.microsoft.com/en-us/research/blog/lambda-the-ultimatae-excel-worksheet-function/ LAMBDA: The ultimate Excel worksheet function])
 
{{works with|Office 265 Betas 2010}}
<lang lisp>ISPANGRAM
=LAMBDA(s,
LET(
abc, CHARS(LOWER("abcdefghijklmnopqrstuvwxyz")),
AND(
LAMBDA(c,
ISNUMBER(SEARCH(c, s, 1))
)(
abc
)
)
)
)</lang>
 
And assuming that the name CHARS is also bound in the Name Manager
 
to the generic (String -> Array Char) lambda:
 
<lang lisp>CHARS
=LAMBDA(s,
MID(s, ROW(INDIRECT("1:" & LEN(s))), 1)
)</lang>
{{Out}}
{| class="wikitable"
|-
|||style="text-align:right; font-family:serif; font-style:italic; font-size:120%;"|fx
! colspan="2" style="text-align:left; vertical-align: bottom; font-family:Arial, Helvetica, sans-serif !important;"|=ISPANGRAM(A2)
|- style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff;"
|
| A
| B
|- style="text-align:left;"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 1
| style="text-align:right; font-weight:bold" | Test strings
| style="font-weight:bold" | Verdicts
|- style="text-align:right;"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 2
| style="text-align:right;" | The quick brown fox jumps over the lazy dog
| style="background-color:#cbcefb; text-align:left; " | TRUE
|- style="text-align:right;"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 3
| style="text-align:right;" | Is this a pangram
| style="text-align:left; | FALSE
|- style="text-align:right;"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 4
| style="text-align:right;" | How vexingly quick daft zebras jump!
| style="text-align:left;" | TRUE
|- style="text-align:right;"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 5
| style="text-align:right;" | The five boxing wizards jumped quickly.
| style="text-align:left;| TRUE
|}
 
 
=={{header|F Sharp|F#}}==
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.