remove words from a variable

Hewlett-packard / Rc659aa-aba a1632x
July 21, 2009 at 12:44:27
Specs: Microsoft Windows Vista Home Premium, 2 GHz / 2045 MB
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")

See More: remove words from a variable

Report •


#1
July 21, 2009 at 13:39:59
In batch? That's easy.
set var=www.google.com
set var=%var:www.=%


Report •

#2
July 21, 2009 at 16:27:48
thanks

Report •

#3
July 21, 2009 at 17:52:56
in vbscript, more readable

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

GNU win32 packages | Gawk


Report •

Related Solutions


Ask Question