Search Field parsing

  • Thread starter Thread starter Raterus
  • Start date Start date
R

Raterus

Does anyone know of some code samples that will parse a string field into an array of strings, but do it like a search engine would. I'm sure this would be fun to do it myself, but if an algorithm already exists that would do a much better job, I'm all for it.

Basically it would take something like this

"a field", another field, search on this, "all of this"

and turn it into a string array like this, ignoring comma's, and treating anything between " " as an entire string.

a field
another
field
search
on
this
all of this

Again I'm sure I could write something myself, i'm just looking to save time.
Thanks for any help!

--Michael
 
Hi,

Use string.split.

Dim strOut As String = "a field all of this"
Dim arWords() As String = strOut.Split(" ".ToCharArray)

Ken
------------------
Does anyone know of some code samples that will parse a string field into an
array of strings, but do it like a search engine would. I'm sure this would
be fun to do it myself, but if an algorithm already exists that would do a
much better job, I'm all for it.

Basically it would take something like this

"a field", another field, search on this, "all of this"

and turn it into a string array like this, ignoring comma's, and treating
anything between " " as an entire string.

a field
another
field
search
on
this
all of this

Again I'm sure I could write something myself, i'm just looking to save
time.
Thanks for any help!

--Michael
 
Back
Top