realbasic-nug
[Top] [All Lists]

Re: Quickest way to build a string?

To: realbasic-nug@lists.realsoftware.com
Subject: Re: Quickest way to build a string?
From: "Theodore H. Smith" <delete@elfdata.com>
Date: Fri, 30 Jan 2009 09:45:02 +0000
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <mailman.3695.1233306550.23944.realbasic-nug@lists.realsoftware.com>
References: <mailman.3695.1233306550.23944.realbasic-nug@lists.realsoftware.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

From: Jeremy Cowgar <jeremy@cowgar.com>

What is the quickest/best way to build a string? For instance:

myString = "John Doe"
myString = myString + " had "
myString = myString + " a "
myString = myString + " dog. "

is probably not the best way. Is there a class out there that deals with
a buffer and expands the buffer when necessary?


The FastString class in my plugin.

fs = new FastString
fs.AppendData "John Doe"
fs.AppendData " had "
fs.AppendData " a "
fs.AppendData " dog. "

mystring = fs

FastString has so many tricks to make things faster... For example you can set the size exactly if you want, or if not i assumes the size doubles if it runs out of buffer space. Or it can even write to a file when it runs out of internal buffer space, so there's no need to resize the buffer at all.

it's also got so many utility functions to make things faster. Like .AppendIntegerAsText...

--
http://elfdata.com/plugin/
"String processing, done right"



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>