Friday, January 4, 2008

Inbuilt Interface Using Dotnet

1) IEnumerator


Definition:

Using this interface you can read the array,string, Performance is good.


Example:1

string[] sdss ={ "test", "test1" };

IEnumerator enumerator = sdss.GetEnumerator();
while (enumerator.MoveNext())
{
Response.Write(enumerator.Current.ToString() +"
");
}

output

test
test1

Example:2

string s="dd";
IEnumerator enumerator = s.GetEnumerator();
while (enumerator.MoveNext())
{
Response.Write(enumerator.Current.ToString() +"
");

}

output

d
d