cancel
Showing results for 
Search instead for 
Did you mean: 
rigonzalez
Nintex Newbie

replacing text from string

Jump to solution

Hello,

How can I replace all special characters in a workflow? Say you get a string from a SharePoint list: (MyString#1-a). So, I want to remove all special characters from that string: ()#- and I want to replace them with an HTML code for each symbol. So my final string would be: %2528MyString%25231%252Da%2529

where...

%2528 is the parentheses

MyString

%2523 is the #

1

%252D is the -

a

 %2529 is the closing parentheses

Note, I have all the html encoding reference for special characters.

Reply
5 Replies
fhunth
Nintex Newbie

Re: replacing text from string

Jump to solution

Have you seen the fn-Replace function?

View solution in original post

Reply
didosa
Nintex Newbie

Re: replacing text from string

Jump to solution

What you show in your example are not HTML symobls, in fact (MyString#1-a) can be safely used within HTML. You probably need URL-Encoding. Even for the use in an URL, you would only need to replace the # in your example, the other special characters ()- can be used in an url.

Depending on your needs and the possible inputs, assuming you want to create a valid url, you can use a couple of fn-Replace calls (e.g. use some "Build String" Actions) to replace any reserved or unsafe characters like #, /, ., :, &, ?, =, %, blanks etc. Unfortunately there is, as far as i know, no built-in URL-Encoding function in Nintex (while there ist fn-XmlEncode, which creates valid HTML, but is not of help in your case).

Reply
rigonzalez
Nintex Newbie

Re: replacing text from string

Jump to solution

Thank you Fernando, I have studied the fn-Replace function and it has worked for my issue.

Kind Regards,

Ricardo

0 Kudos
Reply
rigonzalez
Nintex Newbie

Re: replacing text from string

Jump to solution

Thank you didosa, the fn-Replace function did the trick. I had to use a lot of {textStrart} {textEnd} tags and I had to cut the concatenation in 3 parts (buildStrings) for it to work. Thanks again!

Kind Regards,

Ricardo

0 Kudos
Reply
chaddavis
Nintex Newbie

Re: replacing text from string

Jump to solution

Don't forget to mark an answer as correct to close this question.

0 Kudos
Reply