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, ∼2574🔥, 0💬
Popular Posts:
What contents are stored in a Web Archive (.mht) file? When you convert a word document into a singl...
How to Add MP3 Folder to Windows Media Player Library ? 1. Start Windows Media Player. 2. Click the ...
How to start and stop a Windows XP service? If you want to start or stop a Windows service, you can ...
A collection of 18 tutorials on Mozilla FireFox 2 covering: How to download and install Mozilla Fire...
How to remove realsched.exe from the startup application list to gain performance and reduce securit...