Java String Sub String substr(String what, int begin, int end)

Here you can find the source of substr(String what, int begin, int end)

Description

substr

License

Open Source License

Declaration

public static String substr(String what, int begin, int end) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String substr(String what, int begin, int end) {
        if (begin > end) {
            return "";
        }//  ww  w.  ja  v  a 2  s.  c o m
        return what.substring(Math.max(0, begin), Math.min(end, what.length() - 1));
    }
}

Related

  1. substr(String str, int length)
  2. subStr(String str, int limit)
  3. subStr(String str, int maxLen)
  4. substr(String str, int startIndex, int length)
  5. substr(String substr1, String substr2)
  6. substr(StringBuffer buf)
  7. substract(double[] a, double[] b)
  8. substract(double[] a, double[] b)
  9. substract(int[] array1, int[] array2)