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, 1515🔥, 0💬
Popular Posts:
Where does Mozilla FireFox 2 store cookie files on my computer? Some cookies are stored to your comp...
What happens if you entered the wrong Passkey on your cell phone? If the Passkey you entered on your...
What is the startup program "Intel Graphics Accelerator Helper - igfxtray.exe" on my Windows 8 compu...
What is the scheduled task "\Microsoft\Windows\NetC fg\BindingWorkItemQueueH andler"on my Windows 8 c...
How to setup a HP laptop computer? I want to buy the new HP laptop computer on sale at Best Buy for ...