|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Good way to do lookups...Let's say that I have a table with like 525 records where each record
contains a string to look for and a string to replace with (e.g. AVENUE, AVE). What I need to do is parse through a string (a street address) and then for each "word/token" found, I want to look it up and replace it if I find it in one of the 525 records. I have two questions... 1) Is there an easy way to tokenize a string (i.e. split it out into its separte words, where words are separated by a space)? For example, tokenizing "Eden Hill Str" would result in three "words": "Eden", "Hill", and "Str". 2) What would be the best way to facilitate searching for each token? One way to do it would be to use a dataset and then there's probably some kind of lookup function I could use (which would take advantage of primary key field which we are actually looking up). Is that the best way or is there a better one? Bob,
You say it yourself use the string.split to create arrays of words. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemstringclasssplittopic.asp Know that there are more split methods and as well much overloaded methods. The opposite from the split is the join http://msdn2.microsoft.com/en-us/library/57a79xd0.aspx I hope this helps, Cor Show quoteHide quote "BobRoyAce" <b***@omegasoftwareinc.com> schreef in bericht news:1149221336.394612.306470@f6g2000cwb.googlegroups.com... > Let's say that I have a table with like 525 records where each record > contains a string to look for and a string to replace with (e.g. > AVENUE, AVE). What I need to do is parse through a string (a street > address) and then for each "word/token" found, I want to look it up and > replace it if I find it in one of the 525 records. I have two > questions... > > 1) Is there an easy way to tokenize a string (i.e. split it out into > its separte words, where words are separated by a space)? For example, > tokenizing "Eden Hill Str" would result in three "words": "Eden", > "Hill", and "Str". > > 2) What would be the best way to facilitate searching for each token? > One way to do it would be to use a dataset and then there's probably > some kind of lookup function I could use (which would take advantage of > primary key field which we are actually looking up). Is that the best > way or is there a better one? >
Calling VB.Net classes from VB6
VB.NET Screen Stops Refreshing After Losing Focus?? Why choose SQL Express over Access? Offset lines appearing over form after delay (NVIDIA Chipset) Why doesn't changing the position in a table change the position of the DatGridView that's bound to UI to enter values into a structure Soap Formatter namespace not found Restart, but after a delay Crypto removing white spaces from byte array ASPX user interface dilemma |
|||||||||||||||||||||||