Deprecating chomp(String, String) per Verneri Åberg's report in LANG-748

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1161997 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2011-08-26 05:19:00 +00:00
parent 2e30bec7af
commit 6cf48caa26
1 changed files with 3 additions and 7 deletions

View File

@ -4381,15 +4381,11 @@ public class StringUtils {
* @param str the String to chomp from, may be null
* @param separator separator String, may be null
* @return String without trailing separator, {@code null} if null String input
* @deprecated This feature will be removed in Lang 4.0
*/
@Deprecated
public static String chomp(String str, String separator) {
if (isEmpty(str) || separator == null) {
return str;
}
if (str.endsWith(separator)) {
return str.substring(0, str.length() - separator.length());
}
return str;
return removeEnd(str,separator);
}
// Chopping