Here you can find the source of truncate(String url, int offset, int size)
private static String truncate(String url, int offset, int size)
//package com.java2s; //Licensed under the Apache License, Version 2.0 (the "License"); public class Main { private static String truncate(String url, int offset, int size) { return url.substring(offset, offset + size - 3) + "..."; }//from w w w . java 2 s.co m }