xsa*_*boi 4 python string character
假设我有一个名为 cool 的字符串,cool 设置为“cool°”
cool = "cool°"
Run Code Online (Sandbox Code Playgroud)
如何从字符串中删除度数符号?
由于字符串是不可变的,因此使用替换函数重新分配 cool
cool = "cool°"
cool = cool.replace("°","")
cool
'cool'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13996 次 |
| 最近记录: |