Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2007

Tip: Looking for answers? Try searching our database.

Escaping a formatter {} in StreamWriter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BR - 11 Sep 2007 12:30 GMT
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
Göran Andersson - 11 Sep 2007 12:42 GMT
> Hi,
>
[quoted text clipped - 9 lines]
> 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.

Signature

Göran Andersson
_____
http://www.guffa.com

Marc Gravell - 11 Sep 2007 12:48 GMT
{{ and }} perhaps?
> Hi,
>
[quoted text clipped - 12 lines]
> Thanks,
> Roshan

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.