You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Tiago Lacerda (JIRA)" <ji...@apache.org> on 2019/03/03 19:20:00 UTC

[jira] [Commented] (TEXT-86) StrBuilder Add New Replace Method

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

Tiago Lacerda commented on TEXT-86:
-----------------------------------

Hi, I have added a pull request for this issue, let me know if you have any doubts

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