找到每个字符时如何用空格替换逗号
问题描述:
当发现每个字符时如何用空格替换逗号
因为我的csv文件还在数据中包含逗号
how to replace a comma with a space when it finds at every character
because my csv file contains comma in the data also
答
没有简单的解决方案.尽管您可以使用简单的string.replace,它也会在数据字段中找到逗号,而不仅仅是字段分隔符.
您可能要看一下此工具, http://www.filehelpers.com/ [
There is no easy solution. Although you could use a simple string.replace it will find the commas in the data fields also not just the field separators.
You may want to look at this tool, http://www.filehelpers.com/[^]
将文件读入字符串,然后content.Replace(",", " ")
并保存结果返回文件.
Read the file into a string and then content.Replace(",", " ")
and save the result back to the file.