CSharp examples for System.Net.Mail:SmtpClient
Removes trailing en ending single quotes from an E-mail address when they exist
using System.Text.RegularExpressions; public class Main{ #endregion/*ww w .ja v a2 s. c o m*/ #region RemoveSingleQuotes /// <summary> /// Removes trailing en ending single quotes from an E-mail address when they exist /// </summary> /// <param name="email"></param> /// <returns></returns> public static string RemoveSingleQuotes(string email) { if (string.IsNullOrEmpty(email)) return string.Empty; if (email.StartsWith("'")) email = email.Substring(1, email.Length - 1); if (email.EndsWith("'")) email = email.Substring(0, email.Length - 1); return email; } }