help - string.Format syntax

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • matt@mailinator.com

    help - string.Format syntax

    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_ChangeHistor y.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

  • RobinS

    #2
    Re: help - string.Format syntax

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

    Robin S
    ---------------------
    <matt@mailinato r.comwrote in message
    news:1163547924 .228588.288040@ e3g2000cwe.goog legroups.com...
    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_ChangeHistor y.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
    >

    Comment

    Working...