mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-25 02:15:57 +00:00
Merge pull request #4038 from sburris0/master
[Haskell/en] Explain the !! operator
This commit is contained in:
commit
a990544875
@ -61,6 +61,8 @@ not False -- True
|
|||||||
|
|
||||||
-- A string is a list of characters
|
-- A string is a list of characters
|
||||||
['H', 'e', 'l', 'l', 'o'] -- "Hello"
|
['H', 'e', 'l', 'l', 'o'] -- "Hello"
|
||||||
|
|
||||||
|
-- Lists can be indexed with the `!!` operator followed by an index
|
||||||
"This is a string" !! 0 -- 'T'
|
"This is a string" !! 0 -- 'T'
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user