By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,899 Members | 1,190 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,899 IT Pros & Developers. It's quick & easy.

string comparison

P: 2
Im new to .net i doing my project in .net

I need a code for reading a text file and store every string in to an array. Check the array by giving some word.

If the word is found then the full line which the word
contains is store in to a text boxes
Feb 27 '12 #1
Share this Question
Share on Google+
1 Reply

P: 19
To check if str2 is a substring of str1 (that is, str1 contains str2), use the following line:
Expand|Select|Wrap|Line Numbers
  1. if (str1.Contains(str2))
  2.     //put code here
I hope this helps you.
Mar 1 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.