Here you can find the source of rTrim(String str)
Parameter | Description |
---|---|
str | a parameter |
public static String rTrim(String str)
//package com.java2s; /****************************************************************************** * Copyright (C) Devamatre Technologies 2009 * // w w w.j a v a 2 s . c om * This code is licensed to Devamatre under one or more contributor license * agreements. The reproduction, transmission or use of this code or the * snippet is not permitted without prior express written consent of Devamatre. * * Unless required by applicable law or agreed to in writing, software * distributed under the license is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied and the * offenders will be liable for any damages. All rights, including but not * limited to rights created by patent grant or registration of a utility model * or design, are reserved. Technical specifications and features are binding * only insofar as they are specifically and expressly agreed upon in a written * contract. * * You may obtain a copy of the License for more details at: * http://www.devamatre.com/licenses/license.txt. * * Devamatre reserves the right to modify the technical specifications and or * features without any prior notice. *****************************************************************************/ public class Main { /** * Remove trailing whitespace of the specified string using expressions. * * @param str * @return */ public static String rTrim(String str) { return str.replaceAll("\\s+$", ""); } }