Solved

check availability of words in txt file

Posted on 2009-05-18
2
214 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 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