Java String Sub String substring(String str, int off, int len)

Here you can find the source of substring(String str, int off, int len)

Description

this method works different from the regular substring method, the regular substring method takes startIndex and endIndex as second and third argument, this method takes offset and length

License

LGPL

Parameter

Parameter Description
str a parameter
off a parameter
len a parameter

Declaration

public static String substring(String str, int off, int len) 

Method Source Code

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

public class Main {
    /**//from w w w .  j  a  v a 2  s .  c o  m
     * this method works different from the regular substring method, the regular substring method takes startIndex and endIndex as second and third argument,
     * this method takes offset and length
     * @param str
     * @param off
     * @param len
     * @return
     */
    public static String substring(String str, int off, int len) {
        return str.substring(off, off + len);
    }
}

Related

  1. subString(String str, int end)
  2. substring(String str, int index, int length)
  3. subString(String str, int len)
  4. substring(String str, int len)
  5. subString(String str, int num, String token)
  6. subString(String str, int offset, int leng)
  7. substring(String str, int start)
  8. substring(String str, int start)
  9. substring(String str, int start)