天天看点

list模块

一、

   concat(Things) -> string()

    Types:

    Things = [Thing]

    Thing = atom() | integer() | float() | string()

    Concatenates the text representation of the elements of Things. The elements of Things can be atoms, integers, floats or strings.

    > lists:concat([doc, '/', file, '.', 3]).

    "doc/file.3"

    备注:如果Thing不是List,则会被转化成List(类似调用Integer_to_List())再完成拼接。

    备注2:string()代表了可以是真的字符串,也可以是一些非字符串的整数的列表。

二、

    flatten(DeepList) -> List

   Types:

             DeepList = [term() | DeepList]

             List = [term()]

             Returns a flattened version of DeepList.

    备注:扁平化,类似于打开一层层的嵌套,将term()最终组成一个List.

继续阅读