Re: Where is stringbuilder?



"J French" <erewhon@xxxxxxxxxx> wrote in message
news:4535d495.327324791@xxxxxxxxxxxxxxxxxxx
[...]
For L9 := 1 To L Do
BigStr[ L9 + Start ] := SmallStr[ L9 ] ;

That loop could be replaced by a Move.


[...]
Personally I don't think that this is worth worrying about unless
one is doing a heck of a lot of concatenations on the same String

ISTR postings here from people who were adding a single character to
a string a mere ten thousand times or so, and wondering why it was
so slow.

At the risk of starting another code contest, there are _wonderful_
opportunities for premature optimisation in a function that returns
a string containing N instances of character C. And for sufficiently
large N, not even that premature.

'Result:=''; for i:=1 to N do Result:=Result+C;' is _definitely_ the
wrong answer.

Groetjes,
Maarten Wiltink


.



Relevant Pages

  • Re: Check to see a string or single character is a number or character??
    ... If it is ONLY a single character, you can use VB's IsNumeric function; ... Function IsDigitsOnly(Value As String) As Boolean ... Function IsNumberAs Boolean ... ' Get local setting for decimal point ...
    (microsoft.public.vb.general.discussion)
  • String problems
    ... I tried to convert a "single character" string to char type, ... System.out dumps that to ms dos window, ...
    (comp.lang.java.programmer)
  • Re: FAQ 5.3 How do I count the number of lines in a file?
    ... of a certain single character within a string, ... This is fine if you are just looking for a single character. ... around a global pattern match. ...
    (comp.lang.perl.misc)
  • Re: clear all variables but two (how to negateregular expressions: clear -regexp)
    ... The regular expression operators in play here are: ... ^ -> match the start of string ... you need to match a single character since regexp treats ...
    (comp.soft-sys.matlab)
  • Re: Rio 0.3.3
    ... > symbol, but having the string be a key part of the concept of a Rio object, ... > prefix in the string itself is shorter... ... Originally I was using single character strings like riofor ...
    (comp.lang.ruby)