Question Search for strings by its partial name?

MisterWhite

New member
Joined
Sep 14, 2015
Messages
3
Programming Experience
Beginner
So i'm doing some practice exercises and i came across the issue. Lets say we have entered a string : "My name is Tod", "My life is hard", "Do you even lift bruh?". so what i'm asking is what kind of code should it be so that if i type "Tod" in my "search"
it would find that string?
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,792
Location
Sydney, Australia
Programming Experience
10+
The String class includes Contains, StartsWith, EndsWith and IndexOf methods that may be helpful. The first is case-sensitive only while the other three can be case-insensitive if desired.
 
Top Bottom