Java String Sub String subString(String val, int start, int end)

Here you can find the source of subString(String val, int start, int end)

Description

sub String

License

Open Source License

Declaration

public static String subString(String val, int start, int end) 

Method Source Code

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

public class Main {
    public static String subString(String val, int start, int end) {
        if (!isEmpty(val) && val.length() >= end) {
            return val.substring(start, end);
        }//w  ww.j  av  a2 s .  c  om
        return val;
    }

    public static boolean isEmpty(String val) {
        return val == null || val.trim().length() == 0;
    }
}

Related

  1. substring(String text, int begin, int end)
  2. substring(String text, int start, int end)
  3. substring(String text, int startPos, int endPos)
  4. substring(String text, int startPos, int len)
  5. subString(String text, String leadingPart)
  6. SubString(String x, long y)
  7. substring(StringBuffer buf, int start, int lim)
  8. substring2ByteString(String str, int endIndex)
  9. subString4lastIndex(String string, String regex)