Java tutorial
//package com.java2s; public class Main { public static String toIPAddress(String ip) { return "" + Integer.parseInt(ip.substring(0, 3)) + "." + Integer.parseInt(ip.substring(3, 6)) + "." + Integer.parseInt(ip.substring(6, 9)) + "." + Integer.parseInt(ip.substring(9, 12)); } }