Here you can find the source of rtrim(final String str, final char filler)
Parameter | Description |
---|---|
str | a parameter |
filler | a parameter |
public static String rtrim(final String str, final char filler)
//package com.java2s; //License from project: Open Source License public class Main { /**/*ww w. j a va2s . co m*/ * PErforms right trim * * @param str * @param filler * @return */ public static String rtrim(final String str, final char filler) { // TODO: performansi arttirilmali if (str == null) return null; for (int i = str.length() - 1; i >= 0; --i) { if (str.charAt(i) != filler) return str.substring(0, i + 1); } return ""; } }