Skip to content

Commit

Permalink
Refactor StringUtils#remove[IgnoreCase](String, String)
Browse files Browse the repository at this point in the history
- Refactor to use Strings
- StringUtils#remove(String, String)
- StringUtils#removeIgnoreCase(String, String)
- Strings#remove(String, String)
- Javadoc
  • Loading branch information
garydgregory committed Sep 26, 2024
1 parent e4c03c5 commit cdddb82
Show file tree
Hide file tree
Showing 2 changed files with 339 additions and 294 deletions.
11 changes: 6 additions & 5 deletions src/main/java/org/apache/commons/lang3/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -5700,12 +5700,11 @@ public static String remove(final String str, final char remove) {
* @return the substring with the string removed if found,
* {@code null} if null String input
* @since 2.1
* @deprecated Use {@link Strings#remove(String, String) Strings.CS.remove(String, String)}
*/
@Deprecated
public static String remove(final String str, final String remove) {
if (isEmpty(str) || isEmpty(remove)) {
return str;
}
return Strings.CS.replace(str, remove, EMPTY, -1);
return Strings.CS.remove(str, remove);
}

/**
Expand Down Expand Up @@ -5899,9 +5898,11 @@ public static String removeFirst(final String text, final String regex) {
* @return the substring with the string removed if found, {@code null} if
* null String input
* @since 3.5
* @deprecated Use {@link Strings#remove(String, String) Strings.CI.remove(String, String)}
*/
@Deprecated
public static String removeIgnoreCase(final String str, final String remove) {
return Strings.CI.replace(str, remove, EMPTY, -1);
return Strings.CI.remove(str, remove);
}

/**
Expand Down
Loading

0 comments on commit cdddb82

Please sign in to comment.