@@ -0,0 +1,457 @@
+import java.io.*;%0Aimport java.util.*;%0A%0Apublic class URLify%0A%7B%0A%09public static void main(String%5B%5D args)%0A%09%7B%0A%09%09System.out.println(%22Enter a string and its length%22);%0A%09%09Scanner sc=new Scanner(System.in);%0A%09%09String s=sc.nextLine();%0A%09%09int l=sc.nextInt();%0A%0A%09%09URLify obj=new URLify();%0A%09%09obj.convertToURL(s,l);%0A%09%7D%0A%0A%09public void convertToURL(String s, int l)%0A%09%7B%0A%09%09String s1=s.trim();%0A%09%09String s2=s1.replace(%22 %22, %22%2520%22);%0A%09%09System.out.println(%22URLified string is:%22+s2);%0A%09%7D%0A%7D

Replacing spaces in string with %20