You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Noe Detore <nd...@minerkasch.com> on 2018/04/05 14:31:57 UTC
Escape Single Quote
Need to escape single quote for PutSql. 'Today's forecast ...' by a
backslash: 'Today\'s forecast ...', How can this be done using ReplaceText?
${my_forcast:replace("'","\'")} does not work.
Re: Escape Single Quote
Posted by Noe Detore <nd...@minerkasch.com>.
that was it. Thank you
On Thu, Apr 5, 2018 at 11:12 AM, James Wing <jv...@gmail.com> wrote:
> I believe you need something like
>
> ${my_forcast:replace("'","\\'")}
>
> Using two backslashes \\. The backslash is also used as an escape
> character in the expression language string, so you need two consecutive
> backslashes to make one literal backslash in the output.
>
> On Thu, Apr 5, 2018 at 7:31 AM, Noe Detore <nd...@minerkasch.com> wrote:
>
>> Need to escape single quote for PutSql. 'Today's forecast ...' by a
>> backslash: 'Today\'s forecast ...', How can this be done using ReplaceText?
>> ${my_forcast:replace("'","\'")} does not work.
>>
>
>
Re: Escape Single Quote
Posted by James Wing <jv...@gmail.com>.
I believe you need something like
${my_forcast:replace("'","\\'")}
Using two backslashes \\. The backslash is also used as an escape
character in the expression language string, so you need two consecutive
backslashes to make one literal backslash in the output.
On Thu, Apr 5, 2018 at 7:31 AM, Noe Detore <nd...@minerkasch.com> wrote:
> Need to escape single quote for PutSql. 'Today's forecast ...' by a
> backslash: 'Today\'s forecast ...', How can this be done using ReplaceText?
> ${my_forcast:replace("'","\'")} does not work.
>