Your string indicates that you want to call the static Format
method on the String
class, like so:
_userOptions.DisplayMessage(string.Format(
"\nFile Generated: {0}\nTime Elapsed: {1} minute(s) {2} second(s)\n",
BinaryWriter.GetBinaryFileName(filePath, Convert.ToInt32(logSelected)),
timeSpan.Minutes, timeSpan.Seconds, timeSpan.Milliseconds / 10));
However, this will give you a problem, as you have more parameters than you have placeholders in the string.
Additionally, given comments regarding the use of "\n" as a new line delimiter, unless you have a specific need for that specific format (and it does not seem that you do, you aren't indicating you are writing to a file, or to something where the data is going to an external system), it's better to use Environment.NewLine
, which you can use like so (note, this still does not address the fact you have more parameters than you do placeholders:
_userOptions.DisplayMessage(string.Format(
"{0}File Generated: {1}{0}Time Elapsed: {2} minute(s) {3} second(s){0}",
Environment.NewLine,
BinaryWriter.GetBinaryFileName(filePath, Convert.ToInt32(logSelected)),
timeSpan.Minutes, timeSpan.Seconds, timeSpan.Milliseconds / 10));