Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.scripting.vbscript > #11530

Re: How to economically(!) remove a range of unknown(!) characters from a string

From "Dave \"Crash\" Dummy" <invalid@invalid.invalid>
Newsgroups microsoft.public.scripting.vbscript
Subject Re: How to economically(!) remove a range of unknown(!) characters from a string
Date 2017-01-05 13:11 -0500
Organization A noiseless patient Spider
Message-ID <o4m25p$3gp$1@dont-email.me> (permalink)
References (6 earlier) <o4itbq$u0d$1@dont-email.me> <586d2174$0$21413$e4fe514c@news.xs4all.nl> <XnsA6F3B95E884CBeejj99@194.109.6.166> <o4kg3j$5bv$1@dont-email.me> <o4lll9$j8d$1@dont-email.me>

Show all headers | View raw


Mayayana wrote:
> "Dave "Crash" Dummy" <invalid@invalid.invalid> wrote
> 
> | > temp = mid(txt,n1,1)
> | > mid(txt,n1,1) = mid(txt,n2,1)
> | > mid(txt,n2,1) = temp
> |
> | You can still come close:
> |
> 
>     It's not hard to work around the Mid statement,
> but it's very inefficient, requiring the allocation of
> new strings. With large strings it gets *very* slow.
> The Mid statement treats the string like an array,
> replacing existing characters with new ones. So you
> don't need to do s = Left(s1, x) & s2 & Right(s1, y)
> You just paste s2 into the existing string at offset
> x. It's a direct write with no allocations.

I thought the point was that you could not use mid() to paste a string
into the string in VBScript.

>    I use that method in VB6 to rebuild strings with
> amazing speed. I use a SafeArray structure to
> point at the memory used by the string and treat
> it as an array. Then I tokenize the string numerically,
> walking the array and dealing with characters as
> numbers. At the same time I allocate a string big
> enough to hold my rebuild and just Mid into it. If
> VBS could do that it could help a lot to avoid the
> clumsy process of string snipping and pasting with
> variants.
> 
>  
> 
> 

-- 
Crash

"The future ain't what it used to be."
~ Yogi Berra ~

Back to microsoft.public.scripting.vbscript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-03 13:40 +0100
  Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-03 08:43 -0500
    Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-03 17:21 +0100
      Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-03 19:33 -0500
        Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-04 10:36 +0100
          Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-04 12:21 +0100
            Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-04 08:31 -0500
              Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-04 17:27 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-04 18:13 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-04 21:53 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 00:33 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-05 09:19 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 10:10 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 10:34 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-05 11:50 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-05 09:44 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 16:50 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-05 17:29 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-05 11:50 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-01-04 22:57 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 09:54 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-01-05 04:51 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 12:17 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-05 09:38 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-01-05 13:11 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 22:42 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-01-05 17:35 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-06 00:46 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-01-05 21:03 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-05 18:41 -0500
  Re: How to economically(!) remove a range of unknown(!) characters from a string Ulrich Möller <knobbi38@arcor.de> - 2017-01-03 15:03 +0100
    Re: How to economically(!) remove a range of unknown(!) characters from a string Ulrich Möller <knobbi38@arcor.de> - 2017-01-03 15:26 +0100
      Re: How to economically(!) remove a range of unknown(!) charactersfrom a string "R.Wieser" <address@not.available> - 2017-01-03 17:33 +0100
    Re: How to economically(!) remove a range of unknown(!) charactersfrom a string "R.Wieser" <address@not.available> - 2017-01-03 17:26 +0100
  Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-03 15:06 +0100
    Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-03 17:29 +0100
  Re: How to economically(!) remove a range of unknown(!) characters from a string "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-01-03 11:17 -0500
    Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-03 17:39 +0100

csiph-web