get first char from string haskell

244

get first char from string haskell -

Prelude> take 1 "hello"
"h"
Prelude> take 1 ""
""
Prelude> head "hello"
'h'
Prelude> head ""
*** Exception: Prelude.head: empty list

Comments

Submit
0 Comments