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日 星期六
GAE is not multi-line
在GAE中如果有多行文字儲存,有\n換行符號
GAE會報錯(
請對model 加上參數 db.StringProperty(multiline=True)
GAE會報錯(
is not multi-line)
請對model 加上參數 db.StringProperty(multiline=True)
訂閱:
文章 (Atom)