Replace String List

I’m confused now. But, I thought this should be easy but I can’t get them right.

I have a list, for example -

“Test One 1” : “Test One 2” : “Test One 3”

How do I change the above list to the below list

“Test 1” : “Test 2” : "Test 3

(basically, I want to remove “One” from all of the elements from the list).

Your help is appreciated.

Subject: Replace String List

@ReplaceSubstring(“Test One 1” : “Test One 2” : “Test One 3”;“One “;””)

Subject: RE: Replace String List

Thanks for the quick response. What if the list is actually a field value and I’d like to refer the list as the field value. I tried the below and it doesn’t work:

@ReplaceSubstring(Category;“One “;””)

Thanks again.

Subject: RE: Replace String List

Please don’t say “it doesn’t work” without saying what it does do.

There’s nothing wrong with the formula. The problem must be elsewhere. E.g. your field is not really named Category, or it really contains tabs where you think there are spaces, or you’re not using the return value properly, or you’re assuming that the formula will change the value of the field (in fact it just gives you a new value that was calculated based on the data in the field).

You might try reformulating your question with a little more background information.

Where is this formula (in a view column, in an action button on a form, in an agent,…)? Please give the entire formula. Describe exactly, step by step, what you’re doing and at what point something happens differently than you expected, and what that was.

Subject: RE: Replace String List

Dunno, the @ReplaceSubstring works for me both for a multivalue field and a plain text field which has a literal text “Test One 1” : “Test One 2” : “Test One 3”.

Subject: RE: Replace String List

@Transform(Category;“x”;@If(@Contains(x; “One”);@Left(x;“One”) + “” + @Right(x; “One”);x))

Subject: Replace String List

something like:

@Transform(“Test One 1” : “Test One 2” : “Test One 3”;“x”;@If(@Contains(x; “One”);@Left(x;“One”) + " " + @Right(x; “One”);x))

that should return the list you desire…i haven’t tested that’s a rough draft…

Subject: RE: Replace String List

Thank you all for your help. It works now.