@@ -0,0 +1,1080 @@
+// replace space with %2520%0A// CC 1.3%0A// 9/7/2017%0Apublic class URLify %7B%0A    public static void replaceSpaces(char%5B%5D str, int trueLength) %7B%0A        int spaceCount = 0, index, i = 0;%0A        for (i = 0; i %3C trueLength; i++) %7B%0A            if (str%5Bi%5D == ' ')%0A                spaceCount++;%0A        %7D%0A%0A        index = trueLength + spaceCount * 2;%0A        if (trueLength %3C str.length)%0A            str%5BtrueLength%5D = '%5C0';%0A        %0A        for (i = trueLength - 1; i %3E= 0; i--) %7B%0A            if (str%5Bi%5D == ' ') %7B%0A                str%5Bindex-1%5D = '0';%0A                str%5Bindex-2%5D = '2';%0A                str%5Bindex-3%5D = '%25';%0A                index = index - 3;%0A            %7D else %7B%0A                str%5Bindex-1%5D = str%5Bi%5D;%0A                index--;%0A            %7D%0A        %7D%0A    %7D%0A    %0A    public static void main(String%5B%5D args)%0A    %7B%0A        String s = %22Mr John Smith    %22;%0A        char%5B%5D a = new char%5B100%5D;%0A        for (int i = 0; i %3C s.length(); i++)%0A            a%5Bi%5D = s.charAt(i);%0A%0A        replaceSpaces(a, 13);%0A        for (int i = 0; i %3C 20; i++) %0A            System.out.println(a%5Bi%5D);%0A    %7D%0A%7D%0A

replace space %20