Welcome to WebmasterWorld Guest from 188.8.131.52
What's the most efficient way to create a string into a library sorted version? That is dropping any "An ", "A " or "The " e.g. "The Godfather" becomes "Godfather".
In mysql I do the following:
SELECT apnumber, aptitle, IF( aptitle LIKE 'The %', SUBSTRING( aptitle, 5 ) , IF( aptitle LIKE 'A %', SUBSTRING( aptitle, 3 ) , IF( aptitle LIKE 'An %', SUBSTRING( aptitle, 4 ) , aptitle ) ) ) AS sorttitle etc...
I'd like to be able to handle this before mysql but my coffee/sleep deprived brain is making this too hard! :)
See what you can come up with.
[edited by: eelixduppy at 2:41 am (utc) on Aug. 5, 2009]