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, ∼3184🔥, 0💬
Popular Posts:
What is "@%SystemRoot%\ehome\ehs ched.exe,-101"in my Windows 7 service list? And how is "@%SystemRoo...
What is the installed program "Windows SDK AddOn" on my Windows 7 computer? "Windows SDK AddOn" is a...
What Is the VIDEO_TS Folder or Directory on a DVD-Video (Movie) Disc? On a DVD-Video disc, usually a...
How to view system properties on Windows Server 2012? I just want to get some basic information abou...
What is "Remote Access Connection Manager" in my Windows XP service list? And how is "Remote Access ...