This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-text.git


The following commit(s) were added to refs/heads/master by this push:
     new 903e40e  Reuse StringUtils.substringAfter().
903e40e is described below

commit 903e40e661f73f5419e01f7fe780ce6c949f9a51
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat Jun 27 09:27:48 2020 -0400

    Reuse StringUtils.substringAfter().
---
 .../java/org/apache/commons/text/lookup/AbstractStringLookup.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/text/lookup/AbstractStringLookup.java 
b/src/main/java/org/apache/commons/text/lookup/AbstractStringLookup.java
index 8728521..0819ce6 100644
--- a/src/main/java/org/apache/commons/text/lookup/AbstractStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/AbstractStringLookup.java
@@ -17,6 +17,8 @@
 
 package org.apache.commons.text.lookup;
 
+import org.apache.commons.lang3.StringUtils;
+
 /**
  * A default lookup for others to extend in this package.
  *
@@ -78,7 +80,6 @@ abstract class AbstractStringLookup implements StringLookup {
      * @return a new string.
      */
     protected String substringAfter(final String value, final String str) {
-        final int indexOf = value.indexOf(str);
-        return indexOf > -1 ? value.substring(indexOf + str.length()) : EMPTY;
+        return StringUtils.substringAfter(value, str);
     }
 }

Reply via email to