---- Original Message ----
From: rconn
To: ESFabian@zenge.org
Sent: Sunday, 2011. February 27. 09:39
Subject: RE: [Support-t-2635] Re: @SUBST ... how replace character with
a caret?
| Quote:
| Originally Posted by vefatica
| This one behaves rather oddly:
|
|
| Code:
| v:\> echo %@subst[3,%%@char[94],foobar]
| foo^What happened to the rest of the string?
|
| It was overwritten, as you specified.
|
| @SUBST is an overwrite, not an insertion. What you passed to @SUBST
| was "3,%@char[94],foobar". So this translates to :
|
| Write the string "%@char[94]" to the string "foobar", starting at
| position 3. The result is foo%@char[94].
@SUBST[n, string1, string2]: Substitutes string1 starting at position n in string2.
F:\JPSOFT>*for /l %n in (0,1,9) echo %n %@subst[%n,x,0123456]
0 x123456
1 0x23456
2 01x3456
3 012x456
4 0123x56
5 01234x6
6 012345x
7 0123456x
8 0123456x
9 0123456x
Using "xy" as the replacement string has similar result - 2 consecutive characters are replaced with "xy". Based on the above result, I'd like a more explicit explanation of "boundary conditions" (i.e., when position n is not part of the string). And I still do not see why replacing a single character in the string with the caret ^ truncates the string?
--
Steve