Grzesiek Zimnoch Grzesiek Zimnoch - 1 year ago 90
C# Question

c# how to write "if contains substring"?

Can someone tell me how it should look?

if (foundWord.value.Contains("przedaw".Substring(1, 7)))
for foundWord.value == "Sprzedawca" or "Sprzedawca:" or "Sprzedawca: " or "sprzedawca" etc...?


Answer Source

You don't need substring here.

if (foundWord.value.Contains("przedaw"))

if you want to be case insensitive, you may use a ToLower()

if (foundWord.value.ToLower().Contains("przedaw"))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download