Computing.Net > Forums > Programming > remove words from a variable

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

remove words from a variable

Reply to Message Icon

Name: screwed124816
Date: July 21, 2009 at 12:44:27 Pacific
OS: Microsoft Windows Vista Home Premium
CPU/Ram: 2 GHz / 2045 MB
Product: Hewlett-packard / Rc659aa-aba a1632x
Subcategory: Batch
Comment:

Hi,
Does anyone know of a way to remove
keywords from a variable if it exists?
for example, if someone typed in
"www.google.com", then it would be set to
remove any "www."s that it finds? (making the
variable "google.com")



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: July 21, 2009 at 13:39:59 Pacific
Reply:

In batch? That's easy.

set var=www.google.com
set var=%var:www.=%


0

Response Number 2
Name: screwed124816
Date: July 21, 2009 at 16:27:48 Pacific
Reply:

thanks


0

Response Number 3
Name: ghostdog
Date: July 21, 2009 at 17:52:56 Pacific
Reply:

in vbscript, more readable

strUrl = "www.google.com"
WScript.Echo Replace(strUrl,"www.","")

GNU win32 packages | Gawk


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: remove words from a variable

Script to remove lines from a file www.computing.net/answers/programming/script-to-remove-lines-from-a-file/7090.html

how to remove \ from variable www.computing.net/answers/programming/how-to-remove-from-variable/15757.html

Setting variables from a txt file www.computing.net/answers/programming/setting-variables-from-a-txt-file/15639.html