I am in the middle of writing some XML transform logic and now I need a way to convert a String from it's plural form to it's singular form. It will be used when a bean has a property like addresses that returns a list to create:
I don't want to iterate the entire dictionary and right now it doesn't have to be perfect but I want a tight way of getting as close as possible. The code resides in a StringHelper object. Here's my code so far:
Holla at me...<br /><a href="http://codeforfun.wordpress.com" target="_blank" rel="nofollow">http://codeforfun.wordpress.com</a>
Joined: May 26, 2006
oh, and here's my currently failing unit test code. I think I can figure out why it's failing myself but feel free to point out the bug.
I really need help on the algorithm. Is there a better, tighter way?