Java String Sub String substring(String src, int start_idx, int end_idx)

Here you can find the source of substring(String src, int start_idx, int end_idx)

Description

substring

License

Open Source License

Declaration

private static String substring(String src, int start_idx, int end_idx) 

Method Source Code

//package com.java2s;

public class Main {

    private static String substring(String src, int start_idx, int end_idx) {
        byte[] b = src.getBytes();
        String tgt = "";
        for (int i = start_idx; i <= end_idx; i++) {
            tgt += (char) b[i];
        }/*from   w  w  w  .  ja  v  a  2  s .c o  m*/
        return tgt;
    }
}

Related

  1. substring(String source, int offset, int dataLength)
  2. substring(String source, int size)
  3. substring(String source, int startIndex)
  4. subString(String source, int startIndex, int count)
  5. substring(String src, int beginIndex, int endIndex)
  6. subString(String src, int startIndex, int endIndex)
  7. subString(String src, String begin, String end)
  8. substring(String src, String fromToken, String toToken)
  9. subString(String src, String start, String to)