
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
None | size: 0.73 KB | hits: 16 | expires: Never
Is this the best way to determine that a List of ints contains a 0?
if (ALogMsgTypeIntArray.Exists(delegate(int i) { return i == 0; }))
{
MessageBox.Show("0 exists");
}
bGetDebug = ALogMsgTypeIntList.Contains(LogParsePumpViewerConsts.LOG_MSG_TYPE_DEBUG);
bGetInfo = ALogMsgTypeIntList.Contains(LogParsePumpViewerConsts.LOG_MSG_TYPE_INFORMATION);
bGetWarning = ALogMsgTypeIntList.Contains(LogParsePumpViewerConsts.LOG_MSG_TYPE_WARNING);
bGetError = ALogMsgTypeIntList.Contains(LogParsePumpViewerConsts.LOG_MSG_TYPE_ERROR);
if (ALogMsgTypeIntArray.Contains(0))
{
MessageBox.Show("0 exists");
}
if (ALogMsgTypeIntArray.Exists(i => i == 0)
{
MessageBox.Show("0 exists");
}
ALogMsgTypeIntArray.Any(item => item == 0)