Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Console::WriteLine(S"{0} is not a valid file or directory.", path);

 

I know the {0} is where the 'path' variable is placed can someone please tell me how the {0} works and what all this can be used for.

  • *Experts*
Posted

The {0} thing is not specific to WriteLine(); it is a feature of the

[mshelp=ms-help://MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfSystemStringClassFormatTopic.htm]String.Format()[/mshelp] method, which Console.WriteLine() conveniently

calls for you. You can include more parameters by specifying

{1}, {2}, etc. and passing more parameters to the function.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...