Java String Sub String substring(String text, int start, int end)

Here you can find the source of substring(String text, int start, int end)

Description

substring

License

Open Source License

Declaration

public static String substring(String text, int start, int end) 

Method Source Code

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

public class Main {

    public static String substring(String text, int start, int end) {
        if (text == null)
            return null;
        int spos = text.offsetByCodePoints(0, start);
        int epos = text.length() < end ? text.length() : end;
        return text.substring(spos, text.offsetByCodePoints(spos, epos - start));
    }//from w w w .  jav a  2  s  .c  om
}

Related

  1. substring(String string, int start, int length)
  2. substring(String string, String beginning, String end)
  3. subString(String string, String inizio, String fine)
  4. substring(String subject, int start, int end)
  5. substring(String text, int begin, int end)
  6. substring(String text, int startPos, int endPos)
  7. substring(String text, int startPos, int len)
  8. subString(String text, String leadingPart)
  9. subString(String val, int start, int end)