请实现一个函数,将一个字符串中的每个空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。
加载中...
import java.util.*; public class Solution { public String replaceSpace(StringBuffer str) { } }
class Solution { public: void replaceSpace(char *str,int length) { } };
# -*- coding:utf-8 -*- class Solution: # s 源字符串 def replaceSpace(self, s): # write code here
class Solution { public string replaceSpace(string str) { // write code here } }
function replaceSpace(str) { // write code here } module.exports = { replaceSpace : replaceSpace };
# -*- coding:utf-8 -*- class Solution: # s 源字符串 def replaceSpace(self, s): # write code here
package main func ReplaceSpace(s string) string { //write your code here }