Torbjörn Dahlgren
Torbjörn Dahlgren

Reputation: 111

How to print a String in a Label

I want to mix the sting and free text in a label

Exempel:

String inst = "Installing:";

            label1.Text = Inst;

This Works,but If i want to mix the sting "inst" with a text of my own i don't know how.

Exempel 2:

      String Inst = "Installing:";

    label1.Text = inst, "Google Chrome";

This is how I thought the code would look like, but no

Upvotes: 0

Views: 1547

Answers (2)

Mithun Pattankar
Mithun Pattankar

Reputation: 1372

Try this if your looking for C#

String Inst = "Installing:";
label1.Text = string.Format("{0} {1}",inst, "Google Chrome");

Upvotes: 1

A. Berthold
A. Berthold

Reputation: 7

Just try it with:

label1.Text = inst + "Google Chrome";

I think this would work.

Upvotes: 1

Related Questions