[Webinar] Learn how to a build a cloud-first strategyRegister Now


C# string {0}, value

Posted on 2009-12-23
Medium Priority
Last Modified: 2013-12-17

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

Question by:Endelm
LVL 22

Accepted Solution

p_davis earned 1000 total points
ID: 26113395
str = String.Format("Hello {0}", strWorld;)
LVL 11

Assisted Solution

by:Kelvin McDaniel
Kelvin McDaniel earned 1000 total points
ID: 26113398
string str = string.Format("Hello {0}", strWorld);

Author Closing Comment

ID: 31669477

thanks! :)

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month20 days, 12 hours left to enroll

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question