Microsoft MVP성태의 닷넷 이야기
.NET : 104. 배열 원소 비교 [링크 복사], [링크+제목 복사],
조회: 23775
글쓴 사람
정성태 (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)
296정성태5/27/200615995WWF 로 만든 Tetris
294정성태5/21/200616168Session State Uses a Reader-Writer Lock
293정성태5/21/200614851Microsoft Threat Analysis & Modeling v2.0 RC1
291정성태5/18/200616241Managed Stack Explorer
289정성태5/17/200616671Microsoft ASP.NET Providers - PDF 메뉴얼
288정성태5/17/200617111TFS Administration Tool 1.0 Released...with Shared Source!
287정성태5/17/200616165An Introduction to 64-bit Installers with Visual Studio 2005: Part 1
283정성태5/15/200616678Windows Workflow Foundation: Running Service Activated Workflows on Windows Vista and IIS7
284정성태5/15/200616844    답변글 Windows Workflow Foundation: Exposing Workflows as Services [1]
281정성태5/12/200615420Microsoft Compute Cluster Pack SDK
280정성태5/11/200619573C# 3.0 : One-Step Object Creation and Initialization
279정성태5/11/200617654Vista에서 제거되는 DHTML Editing Control
278정성태5/11/200615748LINQ CTP - May 2006
286정성태5/16/200615308    답변글 Using LINQ with ASP.NET (Part 1)
277정성태5/9/200615437Web Application Projects - 정식 릴리스
276정성태5/8/200615815SNK 파일 공유하기파일 다운로드1
275정성태5/8/200615567Building Security Awareness in .NET Assemblies
274정성태5/7/200615443QuickSYS파일 다운로드2
273정성태5/7/200615867Developing Firewalls for Windows 2000/XP파일 다운로드1
272정성태5/6/200617885Windows PowerShell [3]
292정성태5/19/200616025    답변글 Windows PowerShell - PowerShell Script to Create a WorkItem
271정성태5/6/200616236MSBee
282정성태5/15/200616037    답변글 MSBee will be on CodePlex
290정성태5/18/200616583    답변글 MSBuild Extras - Toolkit for .NET 1.1 "MSBee"
270정성태5/4/200616373ISO Recorder
269정성태5/4/200616252Visual Studio 2005 Team System Level 200 Course Material
... 31  32  33  34  35  [36]  37  38  39  40  41  42  43  44  45  ...