From 09b92aa082dead6bffb5666bdf61c57fb15267fc Mon Sep 17 00:00:00 2001 From: Da4Rkclown <118552956+Da4Rkclown@users.noreply.github.com> Date: Sat, 7 Jun 2025 16:02:27 +0530 Subject: [PATCH] added example of indexOf --- content/c-sharp/concepts/strings/terms/indexof/indexof.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/c-sharp/concepts/strings/terms/indexof/indexof.md b/content/c-sharp/concepts/strings/terms/indexof/indexof.md index dfadc40acc2..cb467444e3d 100644 --- a/content/c-sharp/concepts/strings/terms/indexof/indexof.md +++ b/content/c-sharp/concepts/strings/terms/indexof/indexof.md @@ -46,6 +46,14 @@ This example results in the following output: Index: 2 ``` + +string str = "Add some more examples along with their proper explanations"; +int index = str.IndexOf("more"); + +Console.WriteLine("Index: " + index); + +This example results in the following output:9 + ## Codebyte Example The following codebyte is runnable and shows the usage of the `.IndexOf()` method on a string.