| | |
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
Views: 316 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class code color combobox control conversion csharp custom database datagridview dataset datetime degrees development draganddrop drawing encryption enum excel file files form format forms ftp function gdi+ http image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






