def nl2br(string, is_xhtml= True ):
if is_xhtml is True :
return string.replace('\n','
\n')
else :
return string.replace('\n','
\n')
實現explode
>>> str = 'a|b|c|d|e'
>>> str.split("|")
['a', 'b', 'c', 'd', 'e']
實現implode
>>> list = ['a', 'b', 'c', 'd', 'e']
>>> "|".join(list)
'a|b|c|d|e'
2011年6月25日 星期六
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言