Back out a CSU experiment.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@922911 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2010-03-14 17:44:23 +00:00
parent 7780fa0ad5
commit a9b61fc427
2 changed files with 1 additions and 27 deletions

View File

@ -37,32 +37,6 @@ public static int length(CharSequence cs) {
return cs == null ? 0 : cs.length();
}
/**
* <p>
* Reverses a CharSequence as per {@link StringBuilder#reverse()}.
* </p>
*
* <p>
* A <code>null</code> CharSequence returns <code>null</code>.
* </p>
*
* <pre>
* CharSequenceUtils.reverse(null) = null
* CharSequenceUtils.reverse("").toString() = ""
* CharSequenceUtils.reverse("bat").toString() = "tab"
* </pre>
*
* @param str
* the String to reverse, may be null
* @return the reversed String, <code>null</code> if null String input
*/
public static CharSequence reverse(CharSequence str) {
if (str == null) {
return null;
}
return new StringBuilder(str).reverse();
}
/**
* Returns a new <code>CharSequence</code> that is a subsequence of this
* sequence starting with the <code>char</code> value at the specified

View File

@ -5414,7 +5414,7 @@ public static String reverse(String str) {
if (str == null) {
return null;
}
return CharSequenceUtils.reverse(str).toString();
return new StringBuilder(str).reverse().toString();
}
/**