开发者

Django string manipulation

开发者 https://www.devze.com 2023-02-15 16:29 出处:网络
If I received t开发者_StackOverflow社区hrough a post method the following string \'Soccer,Tennis,BaseBall\'

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

精彩评论

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