我正在尝试替换一些文本来休息。 这里我的代码是:关于replace()函数的问题
str = "2014년 8월 19일 오후 11:08, 회원님 : 안녕"
def convert(a):
str.replace("년 ", a)
str.replace("월 ", a)
str.replace("일 ", a)
b = convert(",")
print(b)
和错误是这样的:(pycharm IDE)
C:\Python34\python.exe C:/Users/minseok/PycharmProjects/untitled1/test.py
None
Process finished with exit code 0
我认不出我的问题。 我该怎么办这个错误? 谢谢。
你应该retrun价值形态的转换功能,否则它返回的[为什么不叫Python的字符串方法NOnetype – 2014-09-24 06:27:49
部分重复做任何事情,除非你分配它的输出?](http://stackoverflow.com/questions/9189172/why-doesnt-calling-a-python-string-method-do-anything-unless-you-assign-its-out) – smci 2015-03-02 10:01:01