Forums Register Login

how compare array of string

+Pie Number of slices to send: Send
i would like 2 know how do we compare array of string.
i have 2 array of string and my scenario will compare the element of 1st array
with element of 2nd array then delete the string that match with the second array.
the code what i have is given below..
if there's better ways, maybe you can share to me..

-thanks-

+Pie Number of slices to send: Send
Hi federico, welcome to javaranch.

I think you should use dynamically re-sizable array counterparts like java.util.ArrayList or something of that sort to achieve this. That way, you can insert unique elements from the first array to the list like this



Try to think of how you can implement this concept...
+Pie Number of slices to send: Send
When you get to the level of chars you are not really dealing with characters. You are dealing with numbers. You can do arithmetic on them. Try this
+Pie Number of slices to send: Send
 

Ankit Garg wrote:Hi federico, welcome to javaranch.

I think you should use dynamically re-sizable array counterparts like java.util.ArrayList or something of that sort to achieve this. That way, you can insert unique elements from the first array to the list like this



Try to think of how you can implement this concept...


thanks Ankit
hm...i have try your sugestion, but what does it mean "the current element is unique in the first list" ?
i still don't get it, could you give me by example

Campbell Ritchie wrote:When you get to the level of chars you are not really dealing with characters. You are dealing with numbers. You can do arithmetic on them. Try this


thanks bro..
but i've try and did'nt work.
could you give me by example too, based on my code

sorry i'm just newbie
+Pie Number of slices to send: Send
We don't give out complete answers, only hints. You learn a lot better like that.Works nicely. You will have to use that to produce a result for your comparisons.

I'm not sure if I approve of this interruption. But this tiny ad checks out:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1449 times.
Similar Threads
2 problems.. getting correct file from filechooser to work..turning array into jlabel
regarding peer to peer network through java
String optimization weirdness
Runtime Error - Need Help
generatinf pattern strings
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:19:59.