commons-issues mailing list archives

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


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:
>             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
> 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

This message was sent by Atlassian JIRA

View raw message