Platinum Partner

UpperCase Function Without French Accents


/// 
/// Returns a copy of a string in uppercase, without accents
/// 
/// Valid string expression
/// String converted to uppercase
public static string upperCase (string text) {
	const string accents = "�ÀÄÂÉÈËÊ�Ì�ÎÓÒÖÔÚÙÜÛŸÇ";
	const string normaux = "AAAAEEEEIIIIOOOOUUUUYC";
	string majuscules = text.ToUpper();
	for (int i = 0; i < accents.Length; i++) {
		majuscules = majuscules.Replace(accents.Substring(i, 1), normaux.Substring(i, 1));
	}
	majuscules = majuscules.Replace("Æ", "AE");
	majuscules = majuscules.Replace("Å’", "OE");
	return majuscules;
}

And:

/// 
/// Returns a copy of a string in lowercase, without accents
/// 
/// Valid string expression
/// String converted to lowercase
public static string lowerCase (string text) {
	return upperCase(text).ToLower();
}
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}