2014-03-19 148 views
0

我正在阅读一些使用Java通过Jsoup库的网页的整数值。在表示为xxx,xxx的网站整数中。我需要将这组数据写入.csv文件,以便以后可以通过Excel访问以进行进一步的工作。如何从字符串中删除特定字符?

如何移除中间的逗号使其不影响.csv文件?

+2

thisIsTheString.replace(“‘’”); ...也许表现出一定的努力,从你身边 –

+0

我完全脱离与心灵的....我想我应该去的,该指数逗号并手动删除它 – Zeemaan

回答

1

string.replace(“,”,“”);应该这样做

0
String result = str.substring(0, index) + str.substring(index+1); 

这只是一种可能性,index是要删除的字符位置,str你的java字符串。

0

它必须是一个字符串,当你得到它,以便可以使用firstInstanceOf找到,然后删除它

1
if you want to remove any charactor from a string you can use it. 

    String name="sri,sha,ila,m"; 

    name = name.replace(",",""); 

    Output : srishailam 
相关问题