C Sharp string.IndexOf: Difference between revisions
From Coderwiki
More actions
new: info, example |
(No difference)
|
Latest revision as of 13:05, 15 August 2025
C Sharp implements the IndexOf method on the string type.
See String position for general information on the usage of this method.
Example
edit edit sourcestring haystack = "Hello world, C# is a programming language";
string needle = "C#";
int position = haystack.IndexOf(needle);
Console.WriteLine(position);
Output:
13