Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
first index of a substring in a given string
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { string str = "How to find the first index of a substring in a given string"; string substr = "fir"; bool match; for (int i = 0; i < str.Length - substr.Length + 1; ++i) { match = true; for (int j = 0; j < substr.Length; ++j) { if (str[i + j] != substr[j]) { match = false; break; } } if (match) Console.WriteLine(i); } } } }
run
|
edit
|
history
|
help
0
simult Q3 with latex code + Quad factorization
Trading
ASCII -> Braille ASCII
2 ushort remix to 1 int
qwerty
asxsdxsd
((((STReaming))))%^%% The 2022 RBC Canadian Open Golf PGA Tour event
bst - lot of methods
Singletone Class
test code