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

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

Description

substring

License

Open Source License

Declaration

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

Method Source Code

//package com.java2s;

public class Main {

    public static String substring(String src, int beginIndex, int endIndex) {
        if (src.length() < beginIndex)
            return "";

        return src.substring(beginIndex, endIndex);
    }/*from  www  .  j a  v  a  2 s  . c om*/

    public static String substring(String src, int beginIndex) {
        if (src.length() < beginIndex)
            return "";

        return src.substring(beginIndex);
    }

    public static int length(String s) {
        if (s == null || s.length() == 0)
            return 0;

        return s.length();
    }
}

Related

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