Here you can find the source of substrings(String str, int start, int end)
public static String substrings(String str, int start, int end)
//package com.java2s; public class Main { public static String substrings(String str, int start, int end) { if (str == null) { return null; }/*from w w w . jav a2 s .co m*/ int length = end - start; byte[] dest = new byte[length]; System.arraycopy(str.getBytes(), start, dest, 0, length); return new String(dest); } }