Solved

check availability of words in txt file

Posted on 2009-05-18
2
212 Views
Last Modified: 2013-12-17
i got a txt file in my folder
inside got a list of country name

next i have a textbox , which allows users to input country name
and i need it to check with the country name list in the txt file
list-en1-semic-3.txt
0
Comment
Question by:helloparismiki
2 Comments
 
LVL 1

Accepted Solution

by:
drunk_irishman earned 125 total points
ID: 24413647
think this would work for you.
string[] AllContent = File.ReadAllLines(textfile);
 

foreach (string s in AllContent)

{

   if (s.Contains(TextBox1.Text.ToString()))

            {
 

            }
 

}

Open in new window

0
 
LVL 1

Author Comment

by:helloparismiki
ID: 24414046
i manage to do apply it , thanks ,
but however in the txtfile:-

This list states the country names (official short names in English) in alphabetical...

AFGHANISTAN;AF
ÅLAND ISLANDS;AX


i wanna start read on 3rd line

and instead of read "AFGHANISTAN;AF" , i wanna read "AFGHANISTAN" only
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now