I want to do the following in C# (coming from a Python background):
strVar = \"stack\"
mystr = \"This is %soverflow\" % (strVar)
How do I
You can use the following way
String interpolation
The $ special character identifies a string literal as an interpolated string. e.g.
string name = "Mark";
string surname = "D'souza";
WriteLine($"Name :{name} Surname :{surname}" );//Name :Mark Surname :D'souza
An interpolated string is a string literal that might contain interpolated expressions. When an interpolated string is resolved to a result string, items with interpolated expressions are replaced by the string representations of the expression results.
String.Format
Use String.Format if you need to insert the value of an object, variable, or expression into another string.E.g.
WriteLine(String.Format("Name: {0}, Surname : {1}", name, surname));