剑指offer
替换空格
相似的企业真题
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 64M,其他语言128M
热度指数:1655984
本题知识点:
字符串
算法知识视频讲解
校招时部分企业笔试将禁止编程题跳出页面,为提前适应,练习时请使用在线自测,而非本地IDE。
题目描述
请实现一个函数,将一个字符串中的每个空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。
上一题
下一题
登录
/
注册
我的提交
编辑器加载中...
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 };
function replaceSpace(str) { // write code here }
# -*- coding:utf-8 -*- class Solution: # s 源字符串 def replaceSpace(self, s): # write code here
package main func ReplaceSpace(s string) string { //write your code here }