Convert string to list
##Convert string to list
Calllist()Function
tmpstr = 'abc'tmplist = list(tmpstr)list to string
Calljoinfunction
tmplist = ['a','b','c']tmpstr = ''.join (tmplist)Syntax 'sep'.join(seq)Parameter descriptionsep: separator, can be emptyseq: to link Sequence of elements, strings, tuples, dictionariesUsing sep as the separator, merge all elements of seq into a new stringReturn value: Return a separator with sep The string generated after concatenating each elementThe above is the detailed content of Why string.join(list) instead of list.join(string). For more information, please follow other related articles on the PHP Chinese website!