You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Bruno P. Kinoshita (JIRA)" <ji...@apache.org> on 2015/04/22 11:32:59 UTC

[jira] [Updated] (LANG-895) Improving StringUtils#substringAfterLast

     [ https://issues.apache.org/jira/browse/LANG-895?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bruno P. Kinoshita updated LANG-895:
------------------------------------
    Attachment: LANG-895.patch

Patch with [~ihristov]'s suggested code updated against trunk with tests.

> Improving StringUtils#substringAfterLast
> ----------------------------------------
>
>                 Key: LANG-895
>                 URL: https://issues.apache.org/jira/browse/LANG-895
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.*
>    Affects Versions: 3.1
>         Environment: any
>            Reporter: Ivan Hristov
>            Priority: Minor
>             Fix For: Review Patch
>
>         Attachments: LANG-895.patch
>
>
> At the moment, we have the following method public static String substringAfterLast(String str, String separator) in the class StringUtils which returns an empty string in case no separator is present. I think, it would be handy to be able to control what is returned in case no separator is found. For this reason, I would propose to have a method with the following signature:
> public static String substringAfterLast(String str, String separator, String defaultValue). The same proposal holds for public static String substringAfter(String str, String separator).
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)