Re: Good way to do lookups...

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


"BobRoyAce" <broy@xxxxxxxxxxxxxxxxxxxx> schreef in bericht
news:1149221336.394612.306470@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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?



.



Relevant Pages

  • Problem with String.split(Regex arg)
    ... them out loud. ... a String across the Regex of ".". ... the output of the two argument split methods are as ... And calling the toString method on the String text: ...
    (comp.lang.java)
  • Re: why are overloaded methods statically bound?
    ... >> Anyone know why aren't overloaded methods dynamically bound, ... >> dynamically bound might create paradoxes, ... void method(Object a, Object b, Object c, Object d, String e) {... ...
    (comp.lang.java.programmer)
  • Re: Generic Method Help
    ... believe I can use overloaded methods, because a method can not simply ... private DataSet GetData(string, string, string, string) ... You use generics when the type is not know in advance AND you can treat all ... Sorry for not paying enough attention ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Generic Method Help
    ... believe I can use overloaded methods, because a method can not simply ... private DataSet GetData(string, string, string, string) ... You use generics when the type is not know in advance AND you can treat all ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Thumb rest on a fender P
    ... the opposite is the case -- Originally on the G string side. ... back when most players used their thumb. ... Migration was opposite direction -- ultimately, they put it above the E ...
    (alt.guitar.bass)