Link to home
Start Free TrialLog in
Avatar of MikeMCSD
MikeMCSDFlag for United States of America

asked on

String manipulation help

I have a string that could contain any of the following:

newString = "joseph OR medal OR gold"
newString = "christopher OR medals"
newString = "medals"
newString = "medal"

I want to check "newString" for "medals" or "medal", then I want to replace
the "OR" with "AND" . . something like this:

If newString has "medals" or "medal" Then
  Replace "OR" with "AND"

So the string "joseph OR medal OR gold"  would be "joseph AND medal AND gold"

Also . . .  If just the one word "medals" or "medal" is in the string (newString = "medals")
I want to  Response.Redirect("default.aspx") . . like this:

If newString has ONLY "medal" or "medals"
  Response.Redirect("default.aspx")

thanks
SOLUTION
Avatar of raterus
raterus
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial