int count=20;
float am=100 ;
string symbol=” $”;
string boastStr=”minutes”;
double min=2.50;
Console.Write(“Boast string : I have finished ” + count + ” Apples and Oranges ( ” + am + symbol + “) in ” + min + ” ” + boastStr + ” , wow”) ;
The message is just a joke , lol.
You can put values inside within a single string by using a { }, curly braces and cardinals instead of the old fashioned + operator, but limited to console only. It will look like,
“I have to reach the station at {0}”, min . Can also use many variables in a string.
Lets convert our boast string too
Console.WriteLine (“\nBoast string : I have finished {0} Apples and Oranges ( {1} {2} ) in {3} {4} , wow”,count,am,symbol,min,boastStr );