7
Answers

Read Text from file word by word and store in an array

sajid raja

sajid raja

13y
9.6k
1
Hello Friends

Its sajid here and i am new to C#. i have a query in C#

what i want to do is Read a file that contains some text. i want to read text word by word and  and store those words in an array and then print all those words in array in a list box or drop down..

Please help

Thanks..
Answers (7)
0
Nir Bar
NA 773 0 15y
Hi Petre,

There isn't an automatic way of doing it.
I think the best way will be to count day-by-day in a loop:
int count = 0;
for( DateTime d = dt1.Value.Date; d <= dt2.Value.Date; d = d.AddDays(1))
{

if(( d.DayOfWeek != DayOfWeek.Saturday) && (d.DayOfWeek != DayOfWeek.Sunday))
{
++count
}
}
return count


Please mark this post as an answer if it helps you

Nir