You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Duncan Jones (JIRA)" <ji...@apache.org> on 2016/12/04 21:27:58 UTC
[jira] [Commented] (LANG-1108) Function to replace multiple
whitespaces by a character and trim
[ https://issues.apache.org/jira/browse/LANG-1108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15720630#comment-15720630 ]
Duncan Jones commented on LANG-1108:
------------------------------------
bq. A function that will replace multiple whitespace characters with a single space (or passed string/character) would be a nice feature
[{{StringUtils.normalizeSpace()}}|http://commons.apache.org/proper/commons-lang/javadocs/api-release/org/apache/commons/lang3/StringUtils.html#normalizeSpace-java.lang.String-] solves the first part of this problem. Do we need to solve the remainder?
> 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)