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

Bruno P. Kinoshita commented on LANG-1108:
------------------------------------------

Great idea. I was looking for something similar and thinking whether that would 
make sense in \[text\], but I think it makes sense to add it to \[lang\]. My 
original wish for a function came from this "[TrimAllExcessSpaces 
algorithm|https://algorithmia.com/algorithms/WebPredict/TrimAllExcessSpaces]"; 
from Algorithmia. Unfortunately I'm terrible with names, and have no good 
suggestion for it.

> Function to replace multiple whitespaces by a character and trim
> ----------------------------------------------------------------
>
>                 Key: LANG-1108
>                 URL: https://issues.apache.org/jira/browse/LANG-1108
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Marco Janc
>             Fix For: Discussion
>
>
> In form applications where user can input data its very often not wished to 
> have successive whitespace characters.
> A function that will replace multiple whitespace characters with a single 
> space (or passed string/character) would be a nice feature since I myself 
> repeat this method in many applications.
> Something like a shortcut for:
>     value.replace("\\s+", " ").trim()



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

Reply via email to