Haskell笔记 (6)—— 字符串

(1)

The empty string is written “”, and is a synonym for [].

举例如下:

> "" == []
True

(2)

Since a string is a list of characters, we can use the regular list operators to construct new strings.

举例如下:

> 'a':"bc"
"abc"
> "foo" ++ "bar"
"foobar"

 

发表评论

邮箱地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.