2014-03-19 147 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 
相關問題