Java String Chop chop(String s)

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

Description

chop

License

Open Source License

Declaration

public static String chop(String s) 

Method Source Code

//package com.java2s;

public class Main {
    public static String chop(String s) {
        if (s == null) {
            return (null);
        }/*w w  w  .  j  a  v a2s  . c  om*/

        if (s.length() == 1) {
            return (new String());
        }

        s = s.substring(0, (s.length() - 1));
        return (s);
    }
}

Related

  1. chop(double[][] a, double precision)
  2. chop(final String source)
  3. chop(String aString)
  4. chop(String line)
  5. chop(String s, int i)
  6. chop(String s, int maxLength)
  7. chop(String src, String delim)
  8. chop(String str)