Searching a string inside a string in C#

Searching a string inside a string in C#


using System;

public class Program
{
    public static void Main()
    {
        Console.WriteLine("Searching a string inside a string in C#\n");
        string baseString = "Searching a string";
        string subString = "str";
        int iWhere = baseString.IndexOf(subString);
        Console.WriteLine("Occurred at : " + iWhere + " position");
    }
}
DEMO
Searching a string inside a string in C# Searching a string inside a string in C# Reviewed by Bhaumik Patel on 7:35 PM Rating: 5