Java String Sub String subStr(String src, int len)

Here you can find the source of subStr(String src, int len)

Description

sub Str

License

Open Source License

Declaration

public final static String subStr(String src, int len) 

Method Source Code

//package com.java2s;

public class Main {
    public final static String subStr(String src, int len) {
        if (src.length() <= len)
            return src;

        return src.substring(0, len - 1);
    }//w  w  w .ja v a  2  s. c o  m
}

Related

  1. substr(byte[] i_Value, int i_BeginIndex)
  2. substr(String s, int start, int end)
  3. substr(String s, String sub, boolean before)
  4. substr(String src, int beginIndex, int endIndex)
  5. substr(String src, int nStart, int nLen)
  6. subStr(String src, String split)
  7. substr(String str, int beginIndex, int endIndex)
  8. substr(String str, int iLen)