This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new ae304a603 [LANG-1198] Javadoc: Clarify stripEnd character-set
semantics (#1851)
ae304a603 is described below
commit ae304a603b5aa9622131e3670e1e131b9d87081a
Author: Reassoonn <[email protected]>
AuthorDate: Tue Nov 3 04:56:23 2026 +0800
[LANG-1198] Javadoc: Clarify stripEnd character-set semantics (#1851)
* [LANG-1198] Clarify stripEnd character-set semantics
Explain how stripping trailing characters differs from removing a whole
suffix, with the reported example and links to Strings.CS.removeEnd. This
changes documentation only and preserves the existing API and runtime behavior.
Assisted-By: OpenAI Codex
* [LANG-1198] Remove changelog entry per review
Revert the manually added changes.xml entry as requested by the maintainer.
Preserve the stripEnd documentation clarification.
Assisted-By: OpenAI Codex
* Update src/main/java/org/apache/commons/lang3/StringUtils.java
Co-authored-by: Gary Gregory <[email protected]>
---------
Co-authored-by: rys888 <[email protected]>
Co-authored-by: Gary Gregory <[email protected]>
---
src/main/java/org/apache/commons/lang3/StringUtils.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java
b/src/main/java/org/apache/commons/lang3/StringUtils.java
index 63f9385ee..63916ea08 100644
--- a/src/main/java/org/apache/commons/lang3/StringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringUtils.java
@@ -8128,6 +8128,11 @@ public static String[] stripAll(final String[] strs,
final String stripChars) {
* If the stripChars String is {@code null}, whitespace is stripped as
defined by {@link Character#isWhitespace(char)}.
* </p>
*
+ * <p>
+ * The characters in {@code stripChars} are treated individually, not as a
suffix. To remove a suffix as a whole,
+ * use {@link Strings#removeEnd(String, CharSequence)} on {@link
Strings#CS} instead.
+ * </p>
+ *
* <pre>
* StringUtils.stripEnd(null, *) = null
* StringUtils.stripEnd("", *) = ""
@@ -8138,6 +8143,7 @@ public static String[] stripAll(final String[] strs,
final String stripChars) {
* StringUtils.stripEnd(" abc ", null) = " abc"
* StringUtils.stripEnd(" abcyx", "xyz") = " abc"
* StringUtils.stripEnd("120.00", ".0") = "12"
+ * StringUtils.stripEnd("85123116", "16") = "85123"
* </pre>
*
* @param str The String to remove characters from, may be null.