Java String Shorten shorten(String line)

Here you can find the source of shorten(String line)

Description

Removes the first and last character of the string.

License

GNU General Public License

Parameter

Parameter Description
line The String to be shortened

Return

The substring.

Declaration

public static String shorten(String line) 

Method Source Code

//package com.java2s;
/***************************************
 *            ViPER                    *
 *  The Video Processing               *
 *         Evaluation Resource         *
 *                                     *
 *  Distributed under the GPL license  *
 *        Terms available at gnu.org.  *
 *                                     *
 *  Copyright University of Maryland,  *
 *                      College Park.  *
 ***************************************/

public class Main {
    /**//w  w w . j  av a2s  .  c  om
     * Removes the first and last character of the string.
     *
     * @param line The String to be shortened
     * @return The substring.
     */
    public static String shorten(String line) {
        line = line.trim();

        return (line.substring(1, line.length() - 1).trim());
    }
}

Related

  1. shorten(String fullClassName)
  2. shorten(String in)
  3. shorten(String input)
  4. shorten(String input, int length, boolean wholeWord)
  5. shorten(String label, int maxLength)
  6. shorten(String msg, int front, String join, int end)
  7. shorten(String name, int max)
  8. shorten(String nameForUI, int maxLen)
  9. shorten(String pkg, boolean shorten)