public static string ToEncodeUTF8(this string text) { if (text.IsNullOrEmpty()) { return(text); } var textFormated = string.Empty; //execução text = text.Replace("saÃda", "saída"); text = text.Replace("ÃO", "ão"); text = text.Replace("ão", "ão"); text = text.Replace("Ç", "Ç"); text = text.Replace("ç", "ç"); text = text.Replace("possÃvel", "possível"); text = text.Replace("Transferênciavel", "Transferência"); if (HelperExtension.HasEncodeInText(text)) { var textSplit = text.Split(' '); foreach (var textTemp in textSplit) { var textEncoded = textTemp; if (HelperExtension.HasEncodeInText(textEncoded)) { textEncoded = System.Text.Encoding.UTF8.GetString(System.Text.Encoding.GetEncoding("iso-8859-1").GetBytes(textEncoded.DefaultString())); } textFormated += $" {textEncoded}"; } } else { return(text); } return(textFormated.Trim()); }
public static List <string> GetStringList <T>() { T[] array = HelperExtension.ToArray <T>(); return(array.Select(a => Convert.ToString(a)).ToList()); }
public static List <int> GetIdList <T>() { T[] array = HelperExtension.ToArray <T>(); return(array.Select(a => Convert.ToInt32(a)).ToList()); }