Collections:
Other Resources:
String Variable Match and Replace
How to perform sub-string match and replacement in a string batch variable?
✍: FYIcenter.com
You can perform a sub-string match and replacement in a string batch variable
using the following variable modifier:
%variable:pattern=str%
Wildcard character "*" can be used in "pattern" to match any number of any characters.
Examples of string match and replacement modifiers:
rem Remove all double quotes from a string set variable=%variable:"=% rem Replace all "bar" to "foo" set variable=%variable:bar=foo% rem Remove the drive letter from a path name set java_home=%java_home:*:\=\%
⇒ Get Sub-String from Variable
⇐ What Are Batch Built-in Variables
2021-10-10, ∼2864🔥, 0💬
Popular Posts:
Can I disable Windows service "Spectrum24 Event Monitor" to speedup my computer? Windows service "Sp...
Can I remove startup application "RealPlay.exe - RealPlayer Tray Bar Application" to speedup my comp...
How to dump the list of all processes that are running on my Windows 7 system? I want save names of ...
What is the startup program "IDT PC Audio - sttray64.exe" on my Windows 8 computer? Can I remove it ...
How to edit Mozilla FireFox configuration file? Mozilla FireFox has a configuration file that contro...