Visual C # .NET Messagebox

My question is: can we write:

String s="Sarath";
MessageBox.Show("My Name is Sarath {0}",s);

I want to get the name in {0} ..... Is there a way ...

Thanks in advance.

+3
source share
2 answers

use String.Format for this;)

+4
source
string myName = "Sarath";
MessageBox.Show(String.Format("My name is {0}.", myName));
+2
source

Source: https://habr.com/ru/post/1765398/


All Articles