re:
!Will that work if the first sentence is more than one line long?
!Or if the first sentence is only a few words long?
That should read until the first line-break is found.
Some care will need to be taken when writing that first line. <g>
There's additional caveats, like if the punctuation includes a semi-colon.
Everything before the semi-colon will be interpreted as a line
and everything past the semi-colon ( and until the line-break)
will be interpreted as a second line.
re:
!Don't you need to do some sort of regular expression where you find the
!first instance of a full stop followed by a space and a capital letter...?
Finding the first period and reading everything that came before it would turn the trick, too.
There's also caveats with that method.
See my sig for an example : "Juan T. Llibre, asp.net MVP"
That line has a period followed by a space and a capital letter...but the line doesn't end there.
Bottom line: the problem is a tough nut to crack because of the infinite possibilities in text.
Juan T. Llibre, asp.net MVP
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
=============== =============== ========
"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message news:u1******** ******@TK2MSFTN GP06.phx.gbl...
"Juan T. Llibre" <no***********@ nowhere.comwrot e in message news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>>For string extraction function in vb, if I feed in a paragraph, how do
I extract the first sentence of that paragraph.
Dim sr As New IO.StreamReader ("drive:\direct ory\somefile.tx t")
sr.ReadLine( )
Will that work if the first sentence is more than one line long? Or if the first sentence is only a few words long?
Don't you need to do some sort of regular expression where you find the first instance of a full stop followed by a
space and a capital letter...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net