Return to Snippet

Revision: 31939
at September 16, 2010 05:08 by freder


Initial Code
function compare_strings(a, b) {	
	a = a.toLowerCase();
	a = a.replace("ä", "ae");
	a = a.replace("ö", "oe");
	a = a.replace("ü", "ue");
	a = a.replace("ß", "ss");

	b = b.toLowerCase();
	b = b.replace("ä", "ae");
	b = b.replace("ö", "oe");
	b = b.replace("ü", "ue");
	b = b.replace("ß", "ss");

	return (a == b)? 0: (a > b)? 1: -1;
}

Initial URL

                                

Initial Description

                                

Initial Title
sort strings (that contain umlauts)

Initial Tags
sort, array

Initial Language
JavaScript