How to replace a specific text by another in Response in asp.net
fro globalization for arabian contries I wa开发者_C百科nt to show digits to arabic ones.such as 1--> ۱ ,2--> ۲ ,3-->۳ ....
Is there any way to replace a specific text by another at response?
thanks
public static string ToArabic(string input, string cultureName)
{
CultureInfo culture= new CultureInfo(cultureName);
var arabicDigits = culture.NumberFormat.NativeDigits;
for (int i = 0; i < arabicDigits.Length; i++)
{
input = input.Replace(i.ToString(), arabicDigits[i]);
}
return input;
}
take client culture(e.g. "fa-IR")
and pass it to above method
精彩评论