Batch Variable Character Replacement

noobman

[H]ard|Gawd
Joined
Oct 15, 2005
Messages
1,475
Hey,

I'm almost embarassed to ask this question because it's totally n00bish, and I should know the answer, but here goes:

I have a varaiable with characters I want to replace.
Say i have t(e)st

I want to replace the curve brackets with square brackets

I have this much figured out:

Code:
set MYVAR="t(e)st"
echo %MYVAR:(=[%

Output:
"t[e)st"

How do I replace both characters, as opposed to just one?
 

calebb

[H]F Junkie
Joined
Mar 26, 2000
Messages
8,536
Code:
set MYVAR="t(e)st"
set MYVAR=%MYVAR:)=]%
set MYVAR=%MYVAR:(=[%
echo %MYVAR%
 
Top