I have the following code:
content = Regex.Replace(content, "{%Pwd%}", pwd ?? "");
If pwd is null, I would expect it to be replaced with “” but it is still pulling it in as null.
Anyway, I can fix this. Also why is it not working as expected?
First of all I’d split this line into two:
replacement?"null"?I’m guessing it will be
"null"or""as if replacement wasnullanArgumentNullExceptionwould be thrown.I’d also check that
{%Pwd%}is the correct regular expression – becuase Expresso doesn’t recognise it, it well may need certain characters escaping. Withoutcontentwe can only guess.If you check these things the answer should become apparent.