I want to get character indexes using forach loop.

```
   var text = "aaab";

   foreach (var item in text)
   {
        Console.WriteLine(text.IndexOf(item));
   }

```

The output is : 0 0 0 3

But I expected : 0 1 2 3

so my other operations are going wrong. Why indexOf() method does not get right index?