' Collection of code snippets by Arne VajhÃ¸j 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Module Program
    Sub Main()
        Dim s As String = "Fem Flade flødeboller på et fladt flødebolle fad."
        Console.WriteLine("Første : " & s.ToLower().IndexOf("f"C))
        Console.WriteLine("Sidste : " & s.ToLower().LastIndexOf("f"C))
        Dim ix As Integer = 0
        While 0 <= ix And ix < s.Length
            ix = s.ToLower().IndexOf("f"C, ix)
            If ix >= 0 Then
                Console.WriteLine("Alle : " & ix)
                ix = ix + 1
            End If
        End While
        ix = s.ToLower().IndexOf("f"C)
        ix = s.ToLower().IndexOf("f"C, ix + 1)
        Console.WriteLine("Nummer 2 : " & ix)
        ix = s.ToLower().IndexOf("f"C)
        ix = s.ToLower().IndexOf("f"C, ix + 1)
        ix = s.ToLower().IndexOf("f"C, ix + 1)
        ix = s.ToLower().IndexOf("f"C, ix + 1)
        Console.WriteLine("Nummer 4 : " & ix)
    End Sub
End Module
