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 PROTECTED]