移动开发请实现一个函数,将一个字符串中的每个空格替换成“”。例如,当字符串为We Are Happy.则经过替换之后的字符串为WeAreHappy。 云博小周宇2024年5月5日2023年8月19日1 Min Read public class Solution { public String replaceSpace(StringBuffer str) { return str.toString().replace(" ", "%20"); } }