In c programming language,
I can do
printf("%d\n", value);
But in c#, how can I do it?
For example string is “Good %s everybody”
I want to replace %s with the variable.
Are there any solution except for
str.Replace("%s","good morning");
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
string.Formatwould be your function of choice.You then could write e.g.:
With
{0}being replaced with the value oft.