You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Laurent SCHOELENS (Jira)" <ji...@apache.org> on 2023/03/14 10:38:00 UTC
[jira] [Commented] (LANG-1687) java Document update
[ https://issues.apache.org/jira/browse/LANG-1687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17700085#comment-17700085 ]
Laurent SCHOELENS commented on LANG-1687:
-----------------------------------------
Hi [~typark]
The documentation is correct, the goal of `substringBetween` is to return the first substring between the first occurence of second parameter and the first occurence of the third parameter (after the index of second parameter)
I guess we could add a substringBetween(String, String, String, boolean) with a fourth parameter that could do what you want (get the last occurence of the third parameter) : PR done https://github.com/apache/commons-lang/pull/1038
> java Document update
> --------------------
>
> Key: LANG-1687
> URL: https://issues.apache.org/jira/browse/LANG-1687
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Reporter: taeyongpark
> Priority: Minor
> Time Spent: 40m
> Remaining Estimate: 0h
>
> The example of java document is incorrect.
>
> This is not incorrect:
> {code:java}
> StringUtils.substringBetween("yabczyabcz", "y", "z") = "abc"{code}
> This is correct:
> {code:java}
> StringUtils.substringBetween("yabczyabcz", "y", "z") = "abczyabc"{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)