Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alternative to Mid()
Message
From
12/10/2010 14:28:42
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01484803
Message ID:
01485065
Views:
29
>So you have two strings - one with say 3,000 words and another of about 20K with x words. If the likelihood of words in the 'search for' string not appearing in the 'search in' string is fairly high you could use linq to obtain a list of words that *did* occur and use that as a basis for further manipulation. Something like:
static public List<string> WordsInTarget(string searchFor, string searchIn)
>        {
>            List<string> s = (from x in searchIn.Split() select x).ToList();
>            return (from x in searchFor.Split().Where(x => s.Contains(x)) select x).Distinct().ToList();
>        }
No idea how it would compare speed-wise tho. And Split() might need some parameters....

The split is already implemented. The optimization will probably move up one layer when using SubString().
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform