Microsoft MVP성태의 닷넷 이야기
.NET : 104. 배열 원소 비교 [링크 복사], [링크+제목 복사],
조회: 19121
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 


배열 원소 비교


마침 2개의 바이트 배열을 비교해야 할 일이 있었습니다. 그런데, 왠지 for 루프를 돌면서 일일이 비교하는 것은 구식(?)방법 같아 보여서 검색을 해보았습니다. 근데,,, 그다지 딱히 좋은 방법이 나오지 않다가 저와 같이 동일한 고민을 하는 글을 보게 되었습니다.

Tatham Oddie - Comparing byte arrays in C#, or at least, trying to …
; http://blog.tatham.oddie.com.au/2008/07/01/comparing-byte-arrays-in-c-or-at-least-trying-to/

아쉽게도 고민만 했을 뿐 해결책이 없는 글이었습니다. ^^;

오호... 그런데 댓글을 보니 답이 떡하니 있습니다.

"RichB" 라는 사람의 댓글에,

From System.Linq:

Enumerable.SequenceEqual();

or

Console.WriteLine(new byte[] {1,2,3}.SequenceEqual(new byte[] {1,2,3}));

역시... System.Linq는 훌륭합니다. ^^







[최초 등록일: ]
[최종 수정일: 5/21/2009]


비밀번호

댓글 작성자
 




... 31  32  33  34  35  36  37  [38]  39  40  41  42  43  44  45  ...
NoWriterDateCnt.TitleFile(s)
239정성태4/18/200611613Display a Web Page in a Plain C Win32 Application
238정성태4/17/200611532ASP.NET 2.0 의 Provider 관련 쪽 소스 공개
237정성태4/17/200611225Microsoft Application Verifier
236정성태4/17/200612472IIS6 - IE static resource caching problem
235정성태4/13/200611137"Atlas" Control Toolkit for April CTP Released
234정성태4/13/200611496Access Visual Studio 2005 Team System From Macintosh and UNIX Systems, and from within the Eclipse IDE
233정성태4/13/200611179More Workflow Videos
232정성태4/13/200612154Microsoft Visual C++ 2005 Redistributable Package
231정성태4/13/200611672Windows Presentation Foundation Hands-On-Labs - February 2006 CTP
230정성태4/13/200611520Microsoft Management Model Designer
229정성태4/13/200612515Discovery Wizard for SharePoint
228정성태4/13/200612054TeamPlain Web Access for Team System
227정성태4/13/200611872Scrum for Team System Released
226정성태4/13/200611786Visual Studio Team Foundation Server MSSCCI Provider Version 1.0
224정성태4/13/200611352VC++ - GroupLab Component Library
223정성태4/13/200610485MSBuild Community Tasks Project releases new version
225정성태4/13/20069900    답변글 Visual Studio 2005 Web Application Projects (RC1)
222정성태4/13/200610946Visual Studio 2005 Security Features and Tools
220정성태6/8/200610831Shared Source Common Language Infrastructure 2.0 Release [1]
219정성태8/4/200610676Simple List Extensions Specification
218정성태4/13/2006112953rd party library - EZShellExtensions.Net 1.0 [1]
217정성태4/13/200611067Bug Details: GC fails to load in server mode if config file contains none ASCII characters
215정성태4/13/200611218http://www.400plusdifferences.com/
214정성태4/13/20069701Team Foundation Server, Biztalk 2006
216정성태4/13/200611071    답변글 Team Foundation Server 시험판 공개 다운로드
213정성태4/13/200611154Introduction to the MSN Messenger Activity SDK
... 31  32  33  34  35  36  37  [38]  39  40  41  42  43  44  45  ...