Populating placeholders in a local resource file

129 Views Asked by At

I have the following text in a resource file.

Hello {{studentName}},
Your schedule is  ....

Is there a way to set the placeholder {{studentName}} to a given value, before loading the resource file? I've done this with strings, but not a resource file.

1

There are 1 best solutions below

0
Greg On

OK ... I feel dumb answering my own question, but here goes.

I just need to use the same formatting for strings. Update the file to show

Hello {0},
Your schedule is  ....


string.Format((string)GetLocalResourceObject("ContactText"), "Mike");

Too obvious I guess ...