Is there a function I can apply to a string that will return true of false if a string contains a character.
I have strings with one or more character options such as:
var abc = "s";
var def = "aB";
var ghi = "Sj";
What I would like to do for example is have a function that would return true or false if the above contained a lower or upper case "s".
if (def.Somefunction("s") == true) { }
Also in C# do I need to check if something is true like this or could I just remove the "== true" ?
It will be hard to work in C# without knowing how to work with strings and booleans. But anyway:
You can create your own extention method if you plan to use this a lot.
example usage: