Click here to Skip to main content
15,886,565 members

Response to: Sentences to line with StreamReader txt to txt ?

Revision 3
hi!
you can read all text from the file and split it to sentences using String.Split method. like this:
C#
foreach(string sentence in System.IO.File.ReadAllText(d).Split(new char[]{'.',',','!','?',';'})
            {
                if (!lst.Contains(sentence ))
                {
                    lst.Add(sentence );
                }
            }


[edit] code tags added[/edit]
Posted 8-Nov-12 21:41pm by mehrdad_safa.
Tags: ,