Solved

asp array  - replace string in array

Posted on 2007-11-29
3
2,408 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Html fieldset fix its height and width 4 60
Asp in server side with Mssql Server 7 4 43
Use Mid in Html 6 35
Passing ASP variables in JQuery 4 53
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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