fork download
  1. public class Test {
  2. public static void Main() => System.Console.WriteLine(IndexOf("Olá planeta terra, você é um grande planeta", 'e', 9));
  3. static int IndexOf(string haystack, char needle, int offset) {
  4. for (int i = offset; i < haystack.Length; i++) if (haystack[i] == needle) return i;
  5. return -1;
  6. }
  7. }
  8.  
  9. //https://pt.stackoverflow.com/q/567447/101
Success #stdin #stdout 0.04s 24344KB
stdin
Standard input is empty
stdout
13