Array question

Posted on 2006-04-24
Medium Priority
Last Modified: 2010-04-16
I have 2 string[]

String[] standard = new String[]{"Ronnie", "Jack", "Lori", “Max”, “Tricky”};
String[] temp = new String[]{"Lori", “Max”, "Jack", “Mary”};

Here's are the thing i want to do:

* Use Array "standard" as the standard for Array "temp" to add any name(s) that Array "standrad" has and Array  "temp" doesn't.  Remove any name(s) from Array "temp" that  Array "standrad" doesn't has.  Then sort Array "temp", so that the order and the number of names should be identical between Array "standard" and Array "temp".  Thx
Question by:musclejack

Author Comment

ID: 16529226
Example please. thx
LVL 86

Accepted Solution

Mike Tomlinson earned 1500 total points
ID: 16529330
What an odd question...

If you remove from temp, anything that is not in standard, AND then add to temp anything in standard not already in temp, THEN what you have done is made a COPY of standard!

Why not just CLONE standard using the built-in Clone() method of the Array class, and then sort the Array using the built-in Sort() method:

Your question only makes sense if this is a homework assignment.  In which case you need to show us your attempt and ask specific questions about the problems you are having.  We can't do homework assignments for people.

Apologies if this is NOT homework...

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…
Suggested Courses

599 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