• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

C# string {0}, value

Hi,

I totally forgot how to make readable strings. See example:

How was it done again??

Thank you!!!!


string str;
string strWorld = "world";

str = "Hello {0}", strWorld; // This doesn't work, how is it done again? !!!

Open in new window

0
Endelm
Asked:
Endelm
2 Solutions
 
p_davisCommented:
str = String.Format("Hello {0}", strWorld;)
0
 
Kelvin McDanielSr. Developer/ConsultantCommented:
string str = string.Format("Hello {0}", strWorld);
0
 
EndelmAuthor Commented:
ofcourse!!

thanks! :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now