| | |
comparing contents of 2 arrays
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
perhaps you could do it with one for less by using the Contains method:
The boolean c should be true here because b[2]=3 and a contains 3.
C# Syntax (Toggle Plain Text)
int[] a = new int[4] { 1, 2, 3, 4 }; int[] b = new int[3] { 5, 6, 3 }; bool c = a.Contains(b[2]);
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
![]() |
Similar Threads
- Quick help with printing arrays (Java)
- Comparing and searching two arrays (Pascal and Delphi)
- comparing two flat files (Java)
- help with arrays...immediately... (Java)
- Comparing items in arrays (Perl)
- SUB the contents of two arrays and move the result in a third array (Assembly)
- Looping through arrays (PHP)
Other Threads in the C# Forum
- Previous Thread: Time in C#
- Next Thread: insert commas between digits in number
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format formatting forms function gdi+ httpwebrequest image index input install java label list listbox listener mandelbrot marshalbyrefobject math mouseclick mysql networking object operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






