1 class Replacement { 2 public: 3 string replaceSpace(string iniString, int length) { 4 // write code here 5 for(int m=0;m<iniString.size();) 6 { 7 int i=iniString.find(" ",m); 8 if(i==-1) 9 return iniString; 10 iniString.replace(i,1,"%20"); 11 m=i; 12 } 13 return iniString; 14 } 15 };