samedi 18 octobre 2014

C# method for checking if a string has been passed into a list


Vote count:

0




I'm trying to create a method, in c#, which checks if a string has been passed into a list.



private List<string> _identifiers;

public Profile (string[] names)
{
_identifiers = new List<string>(names);
}

public bool Exists (string id)
{
if ((_identifiers [0] == "id1")&&(_identifiers [1] == "id2"))
{
return true;
}
else
{
return false;
}
}


How can I do this? Thanks!



asked 45 secs ago







C# method for checking if a string has been passed into a list

Aucun commentaire:

Enregistrer un commentaire