473,405 Members | 2,444 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,405 software developers and data experts.

Escaping a formatter {} in StreamWriter

BR
Hi,

I found one issue with the StreamWriter class where the
StreamWriter.Write API interprets anything between { } as a formatter.
So if I write myStreamWriter.Write("This is test code { Ha Ha Ha }
string contd"); then I get a FormatException. I have not been able to
find a clean way of escaping the { ... } so that StreamWriter does not
treat it as a formatter.

Does some one know how to do this?

Thanks,
Roshan

Sep 11 '07 #1
2 1060
BR wrote:
Hi,

I found one issue with the StreamWriter class where the
StreamWriter.Write API interprets anything between { } as a formatter.
So if I write myStreamWriter.Write("This is test code { Ha Ha Ha }
string contd"); then I get a FormatException. I have not been able to
find a clean way of escaping the { ... } so that StreamWriter does not
treat it as a formatter.

Does some one know how to do this?

Thanks,
Roshan
The string is only used as a format if you have more arguments in the
Write call. If you want to write a string, you should have only that
string as argument.

--
Göran Andersson
_____
http://www.guffa.com
Sep 11 '07 #2
{{ and }} perhaps?
"BR" <br*****@gmail.comwrote in message
news:11**********************@19g2000hsx.googlegro ups.com...
Hi,

I found one issue with the StreamWriter class where the
StreamWriter.Write API interprets anything between { } as a
formatter.
So if I write myStreamWriter.Write("This is test code { Ha Ha Ha }
string contd"); then I get a FormatException. I have not been able
to
find a clean way of escaping the { ... } so that StreamWriter does
not
treat it as a formatter.

Does some one know how to do this?

Thanks,
Roshan

Sep 11 '07 #3

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

Similar topics

4
by: Dave Moore | last post by:
Hi All, Can anybody point me to a FAQ or similar that describes what all this stuff is about please?. I'm interfacing with a MySQL database if that's relavent. I've read a couple of books which...
4
by: Gauthier | last post by:
Hi, I've a simple issue with the use of extension objects. I'm trying to call a text formating method from an object that I add to my arguments collection, this method take an input string and...
6
by: Paul Hatcher | last post by:
Hi I'm transforming some XML to HTML but the via XslTransform and a StreamWriter, but I can't get it to obey <xsl:text> escaping rules. I have a statement <xsl:text...
4
by: Patrick De Ridder | last post by:
Which library should I include for the formatter in formatter.Serialize(output, record); Many thanks. -- Patrick De Ridder ngmail@freeler.nl
4
by: Andreas Huber | last post by:
Hello there I need to serialize/deserialize some pretty simple data structures (no inheritance, few has relationships, ~20 classes) in three formats. One is XML (structure is not important as...
2
by: Nadav | last post by:
Hi, I am trying to create a custom formatter ( such as the binary formatter ), I can't figure out where do I bind the input Data Stream with the SerializationInfo object info how should i create...
1
by: Edward Yang | last post by:
When it comes to ViewState in ASP.NET, I have a mixed feeling of both love and hate. For love, it simplifies many aspects of common tasks; for hate, it bloats web pages with large amount of cryptic...
4
by: Jon | last post by:
Hi, I used XslCompiledTransform with the following Xsl file. The <xsl:text disable-output-escaping="yes"does not work when using XslCompiledTransform to do the trnasform (namely the output...
1
by: David Henderson | last post by:
I know 'disable-output-escaping' has been discussed in the past, but I can't put my finger on any of the threads to see if my current problem is addressed. Sorry for re-asking the question if it...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.