Avatar of Bob Schneider
Bob Schneider
Flag for United States of America asked on

Remove part of a string

How can I remove a group of characters that match a search string in asp/vbscript knowing that it may be in the string anywhere or not at all.

For instance, what if I want to remove .js from a string such as " this is.js some string."
ASP

Avatar of undefined
Last Comment
Bob Schneider

8/22/2022 - Mon
SOLUTION
kaufmed

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Bob Schneider

ASKER
I forgot to mention:  what if the string to remove is upper case or mixed case?  I want the end result to be the case that it was to start with/
SOLUTION
Big Monty

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Bob Schneider

ASKER
Here is the deal, and I am sorry if I wasn't more specific right away:

I want to search a user input string for malicious input.  I have a list of malicious inputs that I want to replace, either with a null string (ie: remove them) or some replacement.  The list of malicious strings is in a database.  I write it into an array and then I want to search the user input string for any occurrence of the malicious input.  I don't want to have to include all different case variations of each malicious string (ie: .ru, .RU, .Ru, .rU) in the list.

What is the best way to do this?
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Bob Schneider

ASKER
Aweome help!  Thank you very much!!
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy