This should be easy, but can't find anything to explain it.
Say I am writing something out on console.writeln like:
console.writeln("Jim is a {0} ", xmlscript);
Say I wanted to convert string `"Jim is.." to a resource string in a global resource.resx. It would be:
jimstring jim is a {0}
and I would refer to it in code as
console.writeln(Resources.jimstring)
How to I put the placement variable (xmlscript
) (is this what they are called?) into the resource string in console.writeln?
Thanks,
Bob
As Jeff Johnson mentioned in his answer, it basically the exact same thing as the original Console.WriteLine(). The resource string is just a string. So you reference the resource file and do the format.
If you need it for something other than the Console you can use the String.Format():
var newString = String.Format(resources.jimstring, xmlscript);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With