劍指offer——(2)替換空格

public class Solution { public String replaceSpace(StringBuffer str) { /* 思路一:return str.toString().replace(" ", "%20"); 思路二:計算字符串的空格數量,空出對應的位置依次插入'%''2''0'三個字符
相關文章
相關標籤/搜索