Reputation: 198
I have a method that displays something like:
public void display(){
Console.Writeline("Message");
}
And I should include it in the console.writeline that use string.format (the one inside <<>>
is just how should it look:
int CodeName = 52;
Console.WriteLine("Mutant Name: {0} ------ Message: {1}", CodeName, <<dispplay()>>);
Upvotes: 0
Views: 56
Reputation: 16693
Try calling the display
method by making it return a value.
Like this:
public string display()
{
return "Message";
}
int CodeName = 52;
Console.WriteLine(string.Format("Mutant Name: {0} ------ Message: {1}", CodeName, display()));
Upvotes: 3