import java.io.BufferedReader; import java.io.InputStreamReader; public class Main{ public static void main(String args[]) throws Exception{ BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); String str = ""; while((str = bf.readLine())!= null){ System.out.println(str.replaceAll(" ","%20")); } bf.close(); } }
public static String replaceSpace(StringBuffer str) { String a=str.toString(); String replaceAll = a.replaceAll(" ", "%20"); return replaceAll; }