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, ∼2767🔥, 0💬
Popular Posts:
Where to find tutorials on managing Windows 8 scheduled tasks? Here is a collection of tutorials on ...
Can I disable Windows service "ATI HotKey Poller" to speedup my computer? Windows service "ATI HotKe...
What is naPrdMgr.exe process - Network Associates NAI Product Manager? Process naPrdMgr.exe is the p...
What to Do When HelpSvc.exe Is Running Out of Control - Using High CPU and Memory? If you find your ...
Can I disable Windows service "Spectrum24 Event Monitor" to speedup my computer? Windows service "Sp...