2004年08月19日 星期四 15:02
Hollo guochen:
>>> a="\"fgsdfgsfdgsdf"
>>> a
'"fgsdfgsfdgsdf'
>>> import re
>>> re.sub(r'^\"',' ',a)
' fgsdfgsfdgsdf'
FT 是Python 嘛?好象没有replace 函式的吧??
/******** [2004-08-19]15:00:10 ; guochen wrote:
guochen> 我处理一个文件,读到里面的某个字符串,是"开头的,但是用replace('"','')却删不掉这个引号,怎么处理?
guochen> 请教
guochen> _______________________________________________
guochen> python-chinese list
guochen> python-chinese at lists.python.cn
guochen> http://python.cn/mailman/listinfo/python-chinese
********************************************/
--
Free as in Freedom
Zoom.Quiet
#=========================================#
]Time is unimportant, only life important![
#=========================================#
sender is the Bat!2.12.00
2004年08月19日 星期四 15:09
Zoom.Quiet,您好!
replace是Python的字符串处理函数
我是处理一些HTML文件,其中的部分连接是"/开头,读出来的时候就是"/xxxxx的形式,要把这些"删掉,只留下/xxxxx部分
======= 2004-08-19 15:02:00 您在来信中写道:=======
>Hollo guochen:
>
> >>> a="\"fgsdfgsfdgsdf"
>>>> a
>'"fgsdfgsfdgsdf'
>>>> import re
>>>> re.sub(r'^\"',' ',a)
>' fgsdfgsfdgsdf'
>
>
>
>FT 是Python 嘛?好象没有replace 函式的吧??
>
>
>/******** [2004-08-19]15:00:10 ; guochen wrote:
>
>guochen> 我处理一个文件,读到里面的某个字符串,是"开头的,但是用replace('"','')却删不掉这个引号,怎么处理?
>guochen> 请教
>
>
>guochen> _______________________________________________
>guochen> python-chinese list
>guochen> python-chinese at lists.python.cn
>guochen> http://python.cn/mailman/listinfo/python-chinese
>
>
>********************************************/
>
>--
>Free as in Freedom
>
> Zoom.Quiet
>
>#=========================================#
>]Time is unimportant, only life important![
>#=========================================#
>
>sender is the Bat!2.12.00
>
>_______________________________________________
>python-chinese list
>python-chinese at lists.python.cn
>http://python.cn/mailman/listinfo/python-chinese
= = = = = = = = = = = = = = = = = = = =
致
礼!
guochen
guochen at 1218.com.cn
2004-08-19
Zeuux © 2025
京ICP备05028076号