Oh boy... I made (kind of) a fool of myself: Yes "StrReplace()" is for plain text string replacement
. What I needed, as Datapoint succinctly shows, was
As Xtra also said "Keep it simple.": So Initially the function used was
but this would add unneeded extra space if, like in my example, a string contains many succesive 'n...
I was trying to fix this small part of my script for like 3 hours! I guess at one point your brain can't see clearly.
Back in "the old days" (in the early 90's) when I was coding in plain C (not C++) I would get stuck on a "problem" where the solution was always really obvious and simple, like here. Many times it happened to me... And many times I said to myself "I got to remember that the devil is in the details!"
So, yeah: The goblins are in the details indeed.
Thanks for anyone submitting replies here.