Re: StringBuilder Extension: IsQuotedBy

Frans Bouma <[email protected]> Fri, 15 Feb 2008 18:41:57 +0100
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <016001c86ffa$0fbdc020$2f394060$@nl>
> The problem is not just to remove the delimiter quotes, it is also to
> conditionally remove other pieces of the input, so for each input string, if
> I were to say currentToken = currentToken.Replace(...), up to three or four
> string creations would take place, without a mutable StringBuilder.

        I'm not sure what you're doing with the texts and why they've to
change, but before you end up with a lot of code which handles 1001 special
cases, it's perhaps a good idea to look into creating a proper parser for your
task so you can define what to convert with a set of rules (grammar) so it's
better maintainable. 

        Of course, if the set of tasks to be done on the text is small and the
tasks are very straightforward, no problem, otherwise I'd opt for a parser. 

                FB

> 
> 
> 
> ...
> > Just look at the original topic. The problem is to find surrounding
> > delimiters and remove them. This can all be done easily with no
> > allocation. Why would it be necessary to reverse the delimiter quote
> > by creating a StringBuilder ? I don't want to nitpick on this
> > particular "outlook compiled" code, but you see my point I hope.
> ...
> 
> > Sébastien
> 
> ===================================
> This list is hosted by DevelopMentor®  http://www.develop.com
> 
> View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com