Replacing word in resource string

Shawn Ebeyer asked on September 26, 2016 22:38

Hi all,

I'm trying to replace a word in a resource string with a variable's value.

Here's my code:

{% GetResourceString("Project.type.residential").Replace("#residential#", variable) #%}

but am still outputting my Project.type.residential string in whole.

What am I doing wrong?

Cheers and thanks in advance.

Shawn

Recent Answers


Laura Frese answered on September 27, 2016 00:10 (last edited on December 10, 2019 02:30)

Did you check the event log to see if there was an error? Try

{% GetResourceString("Project.type.residential").ToString().Replace("#residential#", variable) |(identity)GlobalAdministrator%}

0 votesVote for this answer Mark as a Correct answer

Anton Grekhovodov answered on September 27, 2016 07:51

Hi Shawn,

I've checked expression in Macro console. It must work without executing ToString() method: Image Text

So check your event log and check the resource string, does #residential# exist there and is it the same?

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.