Home » C# String GetEnumerator() method

C# String GetEnumerator() method

by Online Tutorials Library

C# String GetEnumerator()

The C# GetEnumerator() method is used to convert string object into char enumerator. It returns instance of CharEnumerator. So, you can iterate string through loop.

Signature

Parameter

It does not take any argument.

Return

It returns System.CharEnumerator.


C# String GetEnumerator() Method Example

Output:

H e l l o   C # 

You may also like