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

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
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 Thu, 05 Jan 2017 13:11:33 -0500
Organization A noiseless patient Spider
Lines 42
Message-ID <o4m25p$3gp$1@dont-email.me> (permalink)
References <586b9ab4$0$21545$e4fe514c@news.xs4all.nl> <o4g9ms$no9$1@dont-email.me> <586bce9a$0$21477$e4fe514c@news.xs4all.nl> <o4hfpn$5f2$1@dont-email.me> <586cc138$0$21471$e4fe514c@news.xs4all.nl> <586cd9ab$0$21472$e4fe514c@news.xs4all.nl> <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>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Thu, 5 Jan 2017 18:10:02 -0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="d9b963e16a5335f5ef3798e43ec0bfdc"; logging-data="3609"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4mXRUaP8xH4wVS82ENC68NBMBa+TfdtQ="
User-Agent Thunderbird 2.0.0.24 (Windows/20100228)
In-Reply-To <o4lll9$j8d$1@dont-email.me>
Cancel-Lock sha1:3MVaYX4OiNPkzZv4M39MEb4M86A=
Xref csiph.com microsoft.public.scripting.vbscript:11530

Show key headers only | 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 | Unroll thread


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