Link to home
Start Free TrialLog in
Avatar of koopa
koopa

asked on

Deleting duplicates from an array

Lets say you have read 30 names from a file into an array with a format like  names: array[1..40] of string[30]; and there are a number of of duplicates in the file and therefor also the array-as you have read the names into the array- please could you write a procedrue which goes through the array and removes all duplicates from the array.
Thanks

 
Avatar of koopa
koopa

ASKER

Adjusted points to 100
Avatar of koopa

ASKER

Please could you reply to the question as soon as possible as I am writing exams on this work in about two weeks
ASKER CERTIFIED SOLUTION
Avatar of scrapdog
scrapdog
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Additional note:  in the example I gave you, it might be hard to read because of the font that experts-exchange uses in its answers.

In the line that looks like this:

if s[i] = s[j] then s[j] := '';


it is important to point out that these are two APOSTROPHES with NO space in between them, *NOT* a quotation mark.  The same goes for the line that is 3 lines below it.  Hopefully you weren't confused by this.

Avatar of koopa

ASKER

Thank you for the brilliant answer it helped me alot !