Methods such as string.Contains and string.IndexOf allow you to search for an occurrence of either a single char or a substring within a string. If you'd like to search for an occurrence of a single char, it is recommended that you use the appropriate method that takes a char as a parameter rather than a string as the former approach is more performant and recommended.
Methods such as
string.Contains
andstring.IndexOf
allow you to search for an occurrence of either a single char or a substring within astring
. If you'd like to search for an occurrence of a single char, it is recommended that you use the appropriate method that takes achar
as a parameter rather than astring
as the former approach is more performant and recommended.