IsNull fonksiyonu parametrenin null veya DBNull olup olmadığını kontrol etmektedir.
public static string GetEnglishLocalizedString(string SearchString)
{
if (!IsNull(SearchString))
{
char[] turkishChars = { 'ı', 'ğ', 'İ', 'Ğ', 'ç', 'Ç', 'ş', 'Ş', 'ö', 'Ö', 'ü', 'Ü' };
char[] englishChars = { 'i', 'g', 'I', 'G', 'c', 'C', 's', 'S', 'o', 'O', 'u', 'U' };
for (int i = 0; i < turkishChars.Length; i++)
{
SearchString = SearchString.Replace(turkishChars[i], englishChars[i]);
}
return SearchString;
}
else
return null;
}
No comments:
Post a Comment