Java String Sub String substring(String S, int beginIndex, int endIndex)

Here you can find the source of substring(String S, int beginIndex, int endIndex)

Description

substring

License

LGPL

Declaration

public static String substring(String S, int beginIndex, int endIndex) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static String substring(String S, int beginIndex, int endIndex) {
        if (beginIndex < endIndex && beginIndex >= 0 && endIndex <= S.length()) {
            return S.substring(beginIndex, endIndex);
        } else {//from  w ww .j a v  a  2 s . c  o m
            return "";
        }
    }

    public static String substring(String S, int beginIndex) {
        return substring(S, beginIndex, S.length());
    }
}

Related

  1. subString(String input, String startStr, String endStr)
  2. subString(String name)
  3. substring(String origin, int len)
  4. subString(String original, String regex)
  5. subString(String parentStr, String startStr, String endStr)
  6. substring(String s, int beginIndex, int endIndex)
  7. substring(String s, int i, String substring, int direction)
  8. subString(String s, int length)
  9. substring(String s, int start)