Home>

I will ask you a question for the first time. For beginners, I'm embarrassed with an ugly question, but I'd appreciate it if you could answer it.

When I was learning about regular expressions, I asked a question because there was a question about WriteLine.
I want to check the usage of $in WriteLine ().
Do you recognize that you can describe properties directly in {} by adding a leading $?
Is this usage of $different from regular expressions?

Applicable source code

Here is the source code picked up from the article on the net.
`` `c #
Source code
var text ="Match method matches specified pattern from input text" ;;
var regex = new Regex (@"match" ;, RegexOptions.IgnoreCase);
var matches = regex.Matches (text);
foreach (Match m in matches)
{
Console.WriteLine ($"Found: {m.Value} at {m.Index}");
}

Tried

For the last Console.WriteLine ($"Found: {m.Value} at {m.Index}");
Console.WriteLine ("Found: {0} at {1}", m.Value, m.Index);

Supplemental information (FW/tool version etc.)

Please provide more detailed information here.

c#