Find the first node that contains the specified value in CSharp
Description
The following code shows how to find the first node that contains the specified value.
Example
using System;/*from www.j a v a 2 s . co m*/
using System.Collections;
using System.Collections.Generic;
public class GenericCollection
{
public static void Main()
{
LinkedList<String> ll = new LinkedList<String>();
ll.AddLast( "A" );
ll.AddLast( "B" );
ll.AddLast( "C" );
ll.AddLast( "java2s.com" );
LinkedListNode<String> t = ll.Find("A");
Console.WriteLine(t.Value);
}
}
The code above generates the following result.