- using System;
- namespace BinarySearchUsingString
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- //Your code goes here
- string[] data = new string[]{"Forget", "Code", "Prasanna", "Senthil" };
- string inputString = Console.ReadLine();
- int index = Array.BinarySearch<string>(data, inputString,StringComparer.OrdinalIgnoreCase);
- if(index > -1){
- Console.WriteLine("Search String ["+inputString+"] found location at "+index);
- }else{
- Console.WriteLine("Search String ["+inputString+"] is not found!");
- }
- }
- }
- }