commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Satyanarayana J (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1173) Addition of stripStartToChar
Date Thu, 15 Oct 2015 12:04:05 GMT

    [ https://issues.apache.org/jira/browse/LANG-1173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14958791#comment-14958791
] 

Satyanarayana J commented on LANG-1173:
---------------------------------------

General use case could be,
two different interfaces maintaining two type for a entity attribute (ex: attribute - vehicle
number : string in one system and int in another system. change might not be possible due
to existing data constraints) 
scenario - one interface A(vehicle number : string) sends vehicle number as "0001" and interface
B(vehicle number : int) do process it(can use Byte,Integer,or Long parsing to convert) and
when they respond to interface A they might send the 'int'.
Here is the data mismatch while compare both values
interface A (0001) <--- interface B (1)

This is a use case I could come up with, not sure If it's of much occurrence across Java applications.

Regarding regex implementations of the method, I couldn't find any straight forward implementation
for the above scenario in any available APIs.

As commons lang has much wider set of StringUtils, I thought it could be a useful addition.

> Addition of stripStartToChar
> ----------------------------
>
>                 Key: LANG-1173
>                 URL: https://issues.apache.org/jira/browse/LANG-1173
>             Project: Commons Lang
>          Issue Type: Wish
>          Components: lang.*
>            Reporter: Satyanarayana J
>            Priority: Minor
>
> Looking for any possibility to add additional methods into StringUtils.
> We already use stripStart , which strips set of leading whitespaces to empty.
> As an addition, can we have below method?
> * stripStartToChar(String str, String/Character char) - leading whitespaces to a specific
character/string 
> or
> * stripStartAndReplace(String str, String stripChars, String/Character char) - leading
characters to a specific character/string
> These methods could be useful to strip leading whitespaces/characters with a replacement
string/characters



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

Mime
View raw message