T
teo
hallo,
I need to extract a word and few text that
precedes and follows it (about 30 + 30 chars)
from a long textual document.
Like the description that Google returns when
it has found a given word.
In example from:
"Sylvia Brunner, a marine mammals researcher at the museum in Fairbanks,
identified the decomposing carcass and oversaw its recovery on Wednesday.
The "bloated, black thing on the beach" was about 12 feet from the river's
edge, she said."
I have to find the 'carcass' word
and finally return with:
"identified the decomposing carcass and oversaw its recovery on"
---
Which is the *fast* method in VbNet?
In VB6 I would have used
InStr (with Binary option because faster)
to find the position of the word,
then Mid to extract the preceding text,
then Mid to extract the following text,
then build up my phrase in this way: text1 & word & text2 .
Any suggestion in VBNet ?
New methods, StringBuilder, Regular Expression... or what else?
I need to extract a word and few text that
precedes and follows it (about 30 + 30 chars)
from a long textual document.
Like the description that Google returns when
it has found a given word.
In example from:
"Sylvia Brunner, a marine mammals researcher at the museum in Fairbanks,
identified the decomposing carcass and oversaw its recovery on Wednesday.
The "bloated, black thing on the beach" was about 12 feet from the river's
edge, she said."
I have to find the 'carcass' word
and finally return with:
"identified the decomposing carcass and oversaw its recovery on"
---
Which is the *fast* method in VbNet?
In VB6 I would have used
InStr (with Binary option because faster)
to find the position of the word,
then Mid to extract the preceding text,
then Mid to extract the following text,
then build up my phrase in this way: text1 & word & text2 .
Any suggestion in VBNet ?
New methods, StringBuilder, Regular Expression... or what else?