[
https://issues.apache.org/jira/browse/TEXT-86?focusedWorklogId=206927&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-206927
]
ASF GitHub Bot logged work on TEXT-86:
--------------------------------------
Author: ASF GitHub Bot
Created on: 03/Mar/19 18:58
Start Date: 03/Mar/19 18:58
Worklog Time Spent: 10m
Work Description: up201809108 commented on pull request #106: TEXT-86
URL: https://github.com/apache/commons-text/pull/106
Fixed Jira issue 86,
https://issues.apache.org/jira/projects/TEXT/issues/TEXT-86?filter=allopenissues,
added replaceAll(char search, String replaceStr) method and consequent unit
tests.
The original methods replace a char for a char or a String for a String. My
method replaces a char for a String.
All other tests continue to pass
Example:
```
StringBuilder sb= new StringBuilder ("test");
sb.replaceAll('t',"th");
sb.toString() => "thesth"
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 206927)
Time Spent: 10m
Remaining Estimate: 0h
> StrBuilder Add New Replace Method
> ---------------------------------
>
> Key: TEXT-86
> URL: https://issues.apache.org/jira/browse/TEXT-86
> Project: Commons Text
> Issue Type: New Feature
> Reporter: BELUGA BEHR
> Priority: Minor
> Fix For: 1.x
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> I was looking at some code and thought TEXT might help. Please add to
> {{org.apache.commons.text.StrBuilder}} a new method signature:
> {code}
> replaceAll(char search, String replaceStr)
> {code}
> This would be helpful for escaping individual characters:
> {code}
> /*
> * (non-Javadoc)
> *
> * @see java.sql.PreparedStatement#setString(int, java.lang.String)
> */
> public void setString(int parameterIndex, String x) throws SQLException {
> x=x.replace("'", "\\'");
> this.parameters.put(parameterIndex,"'"+x+"'");
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)