taks kamps

taks kamps

  • NA
  • 39
  • 6.8k

getting index of character and first instance

Dec 8 2018 8:26 AM
need to get the index of character "d" and first instance of character "n"
that what i have attempted so far
using System;

namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
string greeting = "Good Morning";
int index1, index2;

index1 = greeting['d'];
index2 = greeting['n';


Console.WriteLine(index1 + ", " + index2);
}
}
}

Answers (1)