Reimplementing ToUpper()
问题 How would you write ToUpper() if it didn't exist? Bonus points for i18n and L10n Curiosity sparked by this: http://thedailywtf.com/Articles/The-Long-Way-toUpper.aspx 回答1: I download the Unicode tables I import the tables into a database I write a method upper(). Here is a sample implementation ;) public static String upper(String s) { if (s == null) { return null; } final int N = s.length(); // Mind the optimization! PreparedStatement stmtName = null; PreparedStatement stmtSmall = null;