I want to check if a string contains all the characters of a given word, for example:
var inputString = "this is just a simple text string";
And I will say that I have a word:
var word = "ts";
Now he should select the words containing t and s :
just a string
This is what I'm working on:
var names = Regex.Matches(inputString, @"\S+ts\S+",RegexOptions.IgnoreCase);
however, this does not return to me the words that I like. If I had the same character as t , he would return to me all the words containing t . If I had st instead of ts , he would return the word just to me.
Any idea on how this might work?
source share