Hi guys, sorry about the title :)
Here is my basic problem, I trying to implement an SEO type query for a location.
Here are my examples
- /Leeds
- /Leeds_England
- /Hampshire_England
- /England_Leeds
- /Europe_England
I am trying to get the location, now I am splitting on the '_', then doing a LINQ lookup through my List's for each part. Location has
City Province Region Country Continent
If I find one with a greater count, I set a variable as "cityFound" and append the results to a range of locations.
I then check again using LINQ on these results on the split to see what I've got, to try and work out if each split part is in the same location.
Now I feel I am doing it wrong, but I can't figure out the way to do it "nicely". I think I could create a recursive method, or I'm looking at it totally wrong.
How would you guys tackle this problem? Pseudo code is fine, it's the logic I'm getting stumped on!
Cheers, Sarkie.