Python如何清除字符 [英] Python how to clear characters

查看:67
本文介绍了Python如何清除字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



i有小问题,我有一个var数据,其中包含类似这样的字符串:





['\\\
\t\t\t\t\t\06.05.2014 \t\t\\这是








['\\\
\t\t\t\t\t\01.02.2014 \t\t\\\ \ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\清除所有字符 ['\ n\ t] 只是为了有日期???

任何人都知道如何在python中做到这一点?

Hello,

i have small problem, i have one var "data" which contains of strings like this one:


['\n \t\t\t\t\t\06.05.2014 \t\t\t\t\t\n \t\t\t\t']
.
.
.
.
['\n \t\t\t\t\t\01.02.2014 \t\t\t\t\t\n \t\t\t\t']


So i need to clear all charactes ['\n\t] and just to have date???
Anyone know how to do it in python?

推荐答案

修剪你的字符串,另见 http:// stackoverflow .com / questions / 761804 / trimming-a-string-in-python [ ^ ]
Trim your string, see also http://stackoverflow.com/questions/761804/trimming-a-string-in-python[^]


这篇关于Python如何清除字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆