Here you can find the source of substring(char[] s, int start, int end)
public static char[] substring(char[] s, int start, int end)
//package com.java2s; //License from project: Open Source License public class Main { public static char[] substring(char[] s, int start, int end) { char[] result = new char[end - start]; for (int i = 0; i < result.length; i++) { result[i] = s[start + i];/* w w w. j a v a 2 s.co m*/ } return result; } public static byte[] substring(byte[] s, int start, int end) { byte[] result = new byte[end - start]; for (int i = 0; i < result.length; i++) result[i] = s[start + i]; return result; } public static char[] substring(String s, int start, int end) { return substring(s.toCharArray(), start, end); } }