Java String Chop chop(String str)

Here you can find the source of chop(String str)

Description

Remove the last char in a string

License

Open Source License

Parameter

Parameter Description
str the input string

Return

string after remove of last char

Declaration

public static String chop(String str) 

Method Source Code

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

public class Main {
    /**//from  ww  w . j a v a2s.  co  m
     * Remove the last char in a string
     * 
     * @param str
     *            the input string
     * @return string after remove of last char
     */
    public static String chop(String str) {
        return str.substring(0, str.length() - 1);
    }
}

Related

  1. chop(String s, int i)
  2. chop(String s, int maxLength)
  3. chop(String src, String delim)
  4. chop(String str)
  5. chop(String str)
  6. chop(String str)
  7. chop(String str)
  8. chop(String str)
  9. chop(String str)