help - string.Format syntax

  • Thread starter Thread starter matt
  • Start date Start date
M

matt

hello,

i am accustomed to using the string.Format method in this way:

string foo = string.Format("The formula is {0} * {1}", inputOne,
inputTwo);

but now i am trying to do one where i need squigley brackets in the
string, like so:

crystalWhere = string.Format("{v_ChangeHistory.RevisionID} BETWEEN
{0} AND {1}", inputOne, inputTwo);

....and it craps out on me. im guessing its because of the inclusion of
squigley brackets in my desired string.

how can i fix this?


thanks!
matt
 
To insert curly braces, double them in the format string.
String.Format(" {{{0}}}", 123) --> {123}

Robin S
 
Back
Top