Title Description
Please implement a function, a string to replace each space to "20%." For example, when the string is We Are Happy. After the string is replaced after We% 20Are% 20Happy.
-
# -*- coding:utf-8 -*-
-
class Solution:
-
# S source string
-
def replaceSpace(self, s):
-
# Direct use python properties, will replace spaces into the desired string
-
return s.replace(
' ',
'%20')