Why string.join(list) instead of list.join(string)
May 25, 2019 pm 02:38 PMConvert 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!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

What are the advantages and disadvantages of templating?

Google AI announces Gemini 1.5 Pro and Gemma 2 for developers

For only $250, Hugging Face's technical director teaches you how to fine-tune Llama 3 step by step

Share several .NET open source AI and LLM related project frameworks

A complete guide to golang function debugging and analysis
