So what exactly is the problem? Is it that you can't figure out how to count sentences, that it doesn't compile, both, or something else?
Matthew Small IT Supervisor Showstopper National Dance Competitions 3660 Old Kings Hwy Murrells Inlet, SC 29576 843-357-1847 http://www.showstopperonline.com -----Original Message----- From: Tiffany Blake [mailto:Tiffany_Blake@;gap.com] Sent: Thursday, October 31, 2002 8:58 AM To: ActiveServerPages Subject: .Net text file stream Importance: High sorry - i'm a .net newbie so here goes... - i'm using a text file stream for input - my goal is to output the # of characters, words and sentences - instead of counting # of sentences i counted the # of lines in the file - i have partial solution for characters and words any ideas? here's my code ........ using System; using System.IO; using System.Text; class Class1 { //read a text file to perform string manipulation static void Main(string[] args) { //open text file FileStream inStream = new FileStream("filestream.txt", FileMode.Open); StreamReader reader = new StreamReader(inStream); //initialize counter for file data rows int linenum = 1; //read file and write contents to console for (string line = reader.ReadLine(); line != null;line = reader.ReadLine(), linenum++) Console.WriteLine(line); Console.WriteLine(linenum); // create array to hold all the characters file contents string(line), char[] tbArray = new char[50]; //read string(line) ** HELP ** this is where compile bombs StringReader strReader = new StringReader(line); strReader.Read(tbArray, 0); // Display the output. Console.WriteLine(tbArray); //close file reader.Close(); strReader.Close(); } } ........ thanks and truly greatful (i've been up all nite!) [EMAIL PROTECTED] --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --- You are currently subscribed to activeserverpages as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
