Java tutorial
//package com.java2s; //License from project: Apache License public class Main { /** * Removes last character of String parameter and returns it back * @param stringToTrimLastCharacterOf * @return */ public static String sansLastCharacterOfString(String stringToTrimLastCharacterOf) { return stringToTrimLastCharacterOf.substring(0, stringToTrimLastCharacterOf.length() - 1); } }