小编Pau*_*ock的帖子

Python - Unicode可拆分的东西

我需要将日期值分解为它的元素(8/23/2011),这应该是一块蛋糕

 variable.split("/") 
Run Code Online (Sandbox Code Playgroud)

但它告诉我

'unicode' object has no attribute 'Split'
Run Code Online (Sandbox Code Playgroud)

我尝试将其编码为不同的格式:

date.encode("utf-8")
Run Code Online (Sandbox Code Playgroud)

然后它告诉我

'str' object has no attribute 'Split'
Run Code Online (Sandbox Code Playgroud)

作为Python的新手,似乎我之前使用过split with strings,但我没有把它变成正确的格式或其他东西.或许还有另一种方式更容易.

python unicode split

-1
推荐指数
1
解决办法
7201
查看次数

标签 统计

python ×1

split ×1

unicode ×1