public static string ListToString(IList<string> stringList) { string result = ""; if (stringList != null) { foreach (string value in stringList) { result += "'" + value.Trim() + "',"; } } if (!string.IsNullOrEmpty(result)) { result = result.Remove(result.Length - 1, 1); } return result; }