Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I'm trying to find out if a String contains another string like this:
var s1 = "Test name*" var s2 = "TestName"
If checked now it should return true.
s1
s2
Try this:
var exists = s1.Replace(" ", "").Tolower().Contains(s2.ToLower());
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
s1does not contains2ands2does not contains1in your example, so it is unclear exactly what you are wanting from this.