Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 27th, 2005, 04:41 AM
Registered User
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default StringBuilder


Hi,

I'm looking to add some data to a web page using the STringbuilder method. However I as part of this I want to add in " eg.

MenuString.Append("Testing"are"");

However as soon as it reaches the second " it assumes thats the end of the string and won't add the rest of the data. Can anyone tell me how make it pick up those ".

Cheers
 
Old May 28th, 2005, 01:16 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

this gives you "
Code:
string q=System.Text.Encoding.ASCII.GetString(new byte[]{34});
_____________
Mehdi.
software student.
 
Old May 28th, 2005, 02:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You have to use escape characters like this...
Code:
MenuString.Append("the word \"hippopotamus\" is cool.");
Jacob.

 
Old June 6th, 2005, 08:34 AM
Registered User
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cheers guys. Works a treat

 
Old October 19th, 2010, 10:54 AM
Registered User
 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by welshboy2005 View Post
Hi,

I'm looking to add some data to a web page using the STringbuilder method. However I as part of this I want to add in " eg.

MenuString.Append("Testing"are"");

However as soon as it reaches the second " it assumes thats the end of the string and won't add the rest of the data. Can anyone tell me how make it pick up those ".

Cheers
how to search the string in StringBuilder?

For example:

StringBuilder MyStringBuilder = new StringBuilder();
MyStringBuilder.Append(" What a beautiful day|");
MyStringBuilder.Append("Hello");


so, In this stringBulider how to Identify the "Hello" available r not.
 
Old October 20th, 2010, 06:19 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Please start a new thread rather than tag onto an old one, especially when the two questions are radically different.
Could you also be a bit more specific on what your requirement is?
__________________
Joe
http://joe.fawcett.name/





Similar Threads
Thread Thread Starter Forum Replies Last Post
String And StringBuilder - A Common Mistake Muhammad Zeeshan C# 1 November 23rd, 2007 04:12 AM
StringBuilder select statement GS C# 2005 4 August 26th, 2007 01:42 PM
XmlDocument Vs StringBuilder anup_daware C# 4 February 8th, 2007 09:54 AM
Examples For String And StringBuilder jayakumar.cj ASP.NET 1.0 and 1.1 Basics 0 July 15th, 2006 07:26 AM
String vs. StringBuilder BSkelding VB.NET 2002/2003 Basics 3 June 30th, 2004 08:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.