Home All Groups Group Topic Archive Search About

Searching for strings

Author
25 Mar 2005 7:26 PM
Roshawn Dawson
Hi,

Web sites, like Google, have the ability to remove certain common words
from the users search.  For example, if I were to type "php and .net",
Google would remove the word "and."

So, that brings me to my delimma.  I'm using the Publishers database as
an example.  What I'd like to do is search each book's title and remove
certain common words from it.  The remaining words I'd like to use as
keywords.

Is there any way that this can be accomplished in .NET?

Thanks
Roshawn

Author
25 Mar 2005 7:48 PM
not aaron
First idea that came to my head.
You could make a string array of the common words you dont want to
appear in the string.  Then take the search string, and do a

\\\
for i as integer = 0 to commonword.length-1
  [searchstring] = [searchstring].replace([commonword[i]], "")
next
///

or something along those lines. Im sure there are better ways of doing
this, because this won't deal with the spaces in between the words,
etc.  but it might get you off the ground.

hth
Author
25 Mar 2005 8:52 PM
Herfried K. Wagner [MVP]
"Roshawn Dawson" <udr***@bellsouth.net> schrieb:
> Web sites, like Google, have the ability to remove certain common words
> from the users search.  For example, if I were to type "php and .net",
> Google would remove the word "and."
>
> So, that brings me to my delimma.  I'm using the Publishers database as
> an example.  What I'd like to do is search each book's title and remove
> certain common words from it.  The remaining words I'd like to use as
> keywords.

'Strings.Replace', 'String.Replace', 'Regex.Replace'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>