Here you can find the source of rTrim(String orgStr, String delimiter)
Parameter | Description |
---|---|
String | delimiter |
public static String rTrim(String orgStr, String delimiter)
//package com.java2s; /*/*from w w w.ja va2 s.c om*/ * @(#)MessageUtil.java * * Copyright by ObjectFrontier, Inc., * 2050 Marconi Drive, Alpharetta, GA 30005, U.S.A. * All rights reserved. * * This software is the confidential and proprietary information * of ObjectFrontier, Inc. You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of * the license agreement you entered into with ObjectFrontier. */ public class Main { /** * Right Trim the empty space before the delimiter presents in the string * * @param String orgStr * @param String delimiter * * @return String trimStr * */ public static String rTrim(String orgStr, String delimiter) { try { int index = orgStr.indexOf(delimiter); orgStr = ((orgStr.substring(0, index)).trim().length() > 0) ? orgStr : orgStr.substring(index); return orgStr; } catch (Throwable th) { // ignore exception return orgStr; } } }