using System; using System.Xml.Linq; namespace ConsoleApp1 { internal class Program { public static void Main(string[] args) { Console.WriteLine("Enter name: "); string userStringInput = Console.ReadLine(); Console.WriteLine("Enter charactor to search: "); char userCharInput = Console.ReadLine()[0]; Console.WriteLine(IndexOfChar(userStringInput, userCharInput)); } //Conver to upper case() public static int IndexOfChar(string userString, char userChar) { int index = userString.IndexOf(userChar); return index; } } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter