Proposal: Stringinterpolation

  • Thread starter Thread starter Helium
  • Start date Start date
H

Helium

In some languages, mainly scripting languages, there is a feature
called string interpolation. Something like this would be cool in C#,
too.

# SomeType foo = new SomeType();
# ...
# String str = "The text representation of foo is ${foo}."


This would be translated to:

# String str = "The text representation of foo is " + (foo).toString()
+ "."
 
Hi,

In C# you can also use string.Format ("Text representation: {0}", foo);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top