Java examples for 2D Graphics:Shape
without Last Line
//package com.java2s; public class Main { public static String withoutLastLine(String input) { int lastIndexOf = input.lastIndexOf('\n'); if (lastIndexOf == -1 || lastIndexOf + 1 > input.length()) return input; return input.substring(0, lastIndexOf + 1); }//from w w w . jav a 2s.c o m }