开发者

Django string manipulation

If I received t开发者_StackOverflow社区hrough a post method the following string

'Soccer,Tennis,BaseBall'

How can I, using django, separate the fields into an array in an efficient way?


You wouldn't use Django, you'd use Python.

>>> 'Soccer,Tennis,BaseBall'.split(',')
['Soccer', 'Tennis', 'BaseBall']


'Soccer,Tennis,BaseBall'.split(',')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜