Solved

check availability of words in txt file

Posted on 2009-05-18
2
222 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

717 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