DOS – String Manipulation

DOS – String Manipulation.

emove – Remove a substring using string substitution

Description: The string substitution feature can also be used to remove a substring from another string. The example shown here removes all occurrences of “the ” from the string variable str.
Script:
1.
2.
3.
4.
set str=the cat in the hat
echo.%str%
set str=%str:the =%
echo.%str%
Script Output:
 DOS Script Ouput
the cat in the hat
cat in hat
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s