Here you can find the source of rtrim(String source)
Parameter | Description |
---|---|
source | a parameter |
public static String rtrim(String source)
//package com.java2s; //License from project: LGPL public class Main { /**/*ww w. j a va2s .c o m*/ * remove trailing whitespace * * @param source * @return string without trailing whitespace */ public static String rtrim(String source) { return source.replaceAll("\\s+$", ""); } }