我以前在Java中使用過string.replaceAll(),但沒有遇到任何麻煩,但是我很困惑這一點。我認爲這只是工作,因爲沒有「/」或「$」字符。這是我想要做的:這個Java String.replaceAll()代碼爲什麼不起作用?
String testString = "__constant float* windowArray";
String result = testString.replaceAll("__constant float* windowArray", "__global float* windowArray");
變量結果看起來和testString一樣。我不明白爲什麼沒有改變,請幫助。
哇。我越學習Java,就越喜歡C#。 – Crispy 2010-11-05 21:07:26
可能的[String.replaceAll反斜槓問題]的副本(http://stackoverflow.com/questions/1701839/backslash-problem-with-string-replaceall) – McDowell 2011-05-26 08:32:57