##題目描述 請實作一個函式,將一個字串中的每個空格替換成“%20”,例如,當字串為We Are Happy.則經過替換之后的字串為We%20Are%20Happy,
代碼
public class Solution {
public String replaceSpace(StringBuffer str) {
return str.toString().replace(" ","%20");
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/90048.html
標籤:其他
下一篇:從尾到頭列印鏈表
