0
我試圖從列表中的值中刪除空格。你能幫我找出正確的方法來使用正則表達式來做到這一點嗎? (MY CSV是2列正則表達式 - 空白
到目前爲止:
import csv
import re
f = open('my_file_path')
csv_f = csv.reader(f)
b = csv_f.replace(' ', '')
print b
f.close() - Is the above syntax correct, still getting an error. hmm
替換不會修改字符串,它*返回*刪除空格的副本:'a =「a b」; b = a.replace('',''); - > a ==「a b」和b ==「ab」'。 – Bakuriu