Java tutorial
//package com.java2s; import java.net.MalformedURLException; import java.net.URL; public class Main { public static URL getString(URL str) { String ssString = str.toString(); String[] aaStrings = ssString.split("/"); StringBuilder sb = new StringBuilder(); for (int i = 0; i < aaStrings.length; i++) { if (i == 4) { aaStrings[i] = "180"; } sb.append(aaStrings[i] + "/"); } sb.deleteCharAt(sb.length() - 1); URL url = null; try { url = new URL(sb.toString()); } catch (MalformedURLException e) { e.printStackTrace(); } return url; } }