Search the Community
Showing results for tags 'removing words'.
-
Hi out there; my first question is this: How can I make a rule that removes a specific word from a text string and make a new variable out of the remaining text. Help is appreciated here!
-
Hi, I'm trying to set up a rule for a two-language (double-sided) marketing letter, and I'm running into difficulty setting up the salutation. One side of the letter is in German and the other is in French. My data is in German but I need to remove the German words from the Name field for the salutation on the French side of the letter. Also, some of the records have a generic salutation and others are personalized with the customer's name. Below is the rule I have so far: if (Field("SALUT") == "Sehr geehrte Damen und Herren") { return "<span>" + RawText("Chère Madame cher Monsieur") + "</span>"; } if (Field("SALUT").indexOf("Frau") > -1) { return "<span>" + RawText("Chère") + RawText(" ") + (Field("NAME") + "</span>"); } if (Field("SALUT").indexOf("Herr") > -1) { return "<span>" + RawText("Cher") + RawText(" ") + (Field("NAME") + "</span>"); } else { return "<span>" + RawText("Chère Madame cher Monsieur") + "</span>"; } return ""; The first part of the rule addresses the generic records, "Sehr geehrte Damen und Herren" being the generic German salutation and "Chère Madame cher Monsieur" being the generic French salutation. The 2nd and 3rd if statements address whether to use the feminine or masculine version of the French salutation. "Chère" being the feminine and "Cher" being the masculine. All is working fine until we get to the part where we add the Name field. All of the names are listed the way we address German customers. Examples: "Frau Alexandra Roth" (feminine) "Herrn Roger Brand" (masculine) The customer's names are actually Alexandra Roth and Roger Brand. I need to remove the "Frau" and the "Herrn" from the returned text. The end result needs to be "Chère Alexandra Roth" and "Cher Roger Brand" instead of "Chère Frau Alexandra Roth" and "Cher Herrn Roger Brand." Any help would be greatly appreciated. Thank you
- 2 replies
-
- data
- multi-language
-
(and 2 more)
Tagged with: