Replace character in string with DOS commands

I have a requirement in which I need to replace a specific character from a string using the DOS command.

For example, if my string is "1,2,3,4", I need to get the result "1.2.3.4", replacing each "," with ".". character.

+5
source share
2 answers

The following will work for you

    @echo off
    set string1=1,2,3,4
    set string2=%string1:,=.%
    echo %string2%
+9
source

This will give you an idea of ​​what to do without knowing exactly how to start the line.

set str=1,2,3,4
set str=%str:,=.%
+6
source

All Articles