473,320 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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_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

Nov 14 '06 #1
1 1152
To insert curly braces, double them in the format string.
String.Format(" {{{0}}}", 123) --{123}

Robin S
---------------------
<ma**@mailinator.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.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_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

Nov 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Roger Helliwell | last post by:
Hello Everyone, Has anyone found a quick reference for the many string formatting options for string.Format() ? I'm spending a ridiculous amount of time trying to write one line of code that...
7
by: Alpha | last post by:
Hi, I'm maintaining C# code and am fairly new with C# programming. I'm looking for codes that's droping the 2nd digit of a nuber printed out and I suspect it's the code below. Can someone tell me...
11
by: Matt | last post by:
string format formula to write a text file below is not working for me pos 1 to 10 name pos 15 to 30 lastname pos 45 to 75 job Adam smith programmer string fmt = "{1,10}{15-30}{45,75}"...
2
by: serge calderara | last post by:
Dear all, I have the following item on my form : <asp:HyperLink id="lblEvtNb" runat="server" NavigateUrl="Event.aspx?id=">Click here</asp:HyperLink> I need to pass as url parameter an Id...
2
by: Robert Ludig | last post by:
When I format a number to a string in scientific notation: string.Format("{0:E}",20000); I get the following string (culture de-DE): 2,000000E+003 How can I format scientific notation in...
1
by: matt | last post by:
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...
8
by: Lucky | last post by:
hi guys! back again with another query. the problem is like this. i want to print a line like this: "---------------------------------------------" the easiest way is to simply assign it to...
15
by: James | last post by:
Which is better, which is faster, which is easier etc... ????? String.Format ( "yadda {0} yadda {1}", x, y ) "yadda" + x.ToString() + " yadda" + y.tostring(); My code has a mish mash of...
4
by: Rainer Queck | last post by:
Hi NG, in my application a <myDataTable>.Select fails with "Syntax error in the expression." It took me a while, isolate the cause to this: To select some datarows from a data table I am...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.