[
https://issues.apache.org/jira/browse/TEXT-88?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16048107#comment-16048107
]
Amey Jadiye commented on TEXT-88:
---------------------------------
Hi [~arunvinud],
I think the output passing nothing *or* null *or* empty char array should be
same because the reason given by [[email protected]] that if nothing is passed
white space should be the default delimiter, reason being we are working for
WordUtils and not StringUtils, Thinking with little broader use of WordUtils,
words are always separated by spaces and with given PR we are getting same
output.
{code:java}
WordUtils.capitalizeFully("i am fine") --> I Am Fine
WordUtils.capitalizeFully("i am fine", null) --> I Am Fine
WordUtils.capitalizeFully("i am fine", new char[]{}) --> I Am Fine
{code}
I understand your concern about to consider empty char array should be
considered as no delimiter but as name suggest *capitalizeFully* is made for
capitalising all words in sentence so _no delimiter = null_, if we want to
capitalise just first char of whole sentence we should have different method
with appropriate name.
> WordUtils.capitalizeFully behaves in a counterintuitive manner with empty
> delimiter array.
> ------------------------------------------------------------------------------------------
>
> Key: TEXT-88
> URL: https://issues.apache.org/jira/browse/TEXT-88
> Project: Commons Text
> Issue Type: Bug
> Reporter: Rob Tompkins
>
> As discussed in TEXT-85, it seems that
> {code:java}
> WordUtils.capitalizeFully("i am fine", new char[]{}) // --> i am fine
> {code}
> Both Sebb and Arun think that this is odd and that the letter "i" should have
> been capitalized resulting in the output {{I am fine}}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)