Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify Array Values

Status
Not open for further replies.

Eytch

Programmer
Jan 29, 2003
60
US
I want to be able to replace any array value specified by user input with a replacement value also specified by user input. How do you compare the keyboard input of a character to the literal value occupying an array position?
If array[1]= '2' how do I first find all instances of positions with a '2' in them and replace them with a '3' for example?
Thanks,
Tripoli
 
Depends what type of array it is (ie what type or object is the array of) ?

--------------------------------------------------
Free Database Connection Pooling Software
 
Also, if you're looking to replace a specific position with a different value, it's simply

Code:
array[position] = replacement;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top