循环寻找每一个空格的位置,并替换 public String replaceSpace(StringBuffer str) { int index_of_space = str.indexOf(" "); while (index_of_space != -1) { str.replace(index_of_space, index_of_space + 1, "%20"); index_of_space = str.indexOf(" "); } return str.to...