Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

asp array  - replace string in array

Posted on 2007-11-29
3
Medium Priority
?
2,445 Views
Last Modified: 2008-06-04
I have an array in asp

can someone help me to search for a string in the array that is an exact match (meaning if i search cat it will return cat but not categories) and replace it with another string i specify.
0
Comment
Question by:bottomlinemg
3 Comments
 
LVL 25

Expert Comment

by:kevp75
ID: 20373550
you should be able to get away with using the instr function.  I would do a binary compare though instead of a textual compare...

http://www.w3schools.com/vbscript/func_instr.asp
0
 
LVL 1

Expert Comment

by:esthera
ID: 20373793
can someone help me write a function to do this?
0
 
LVL 28

Accepted Solution

by:
sybe earned 1000 total points
ID: 20373795

   
For i = 0 To Ubound(MyArray)
   If MyArray(i) = "cat" Then MyArray(i) = "another string"
Next 

Open in new window

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question