I’m a network guy, trying to evolve from scripts to GUI development.
But I’m facing this below for every example GPT suggests containing $ sign.
Examples like:
FtpWebRequest ftpRequest = (FtpWebRequest)WebRequest.Create($"{ftpServerUrl}");
or
textBox.Text = $"An error occurred: {ex.Message}";
Result into: Unexpected character ‘$’ (CS1056)
I circumvented by assigning the variable itself without any additional string.
It also works if I concatenate like:
textBox.Text = "An error occurred:" + ex.Message;
I’m using SharpDevelop with nothing else installed (no dotnet SDK).
I want to understand/know how to combine string with text using this $ sign for string interpolation like in the example provided by GPT.
tecepeipe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1