Solved

asp array  - replace string in array

Posted on 2007-11-29
3
2,390 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 250 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now