我面临一个关于如何在同一个String中拆分数字和字符串并显示它的问题。要非常清楚,让我举一个例子,我有一个像
这样的字符串myString = "MH04ED7897"
我希望我的输出像这样
outPut = MH-04-ED-7897
答案 0 :(得分:0)
我是Swift的新手。试试这个
try
{
MailMessage message = new MailMessage(mFrom, "xyz@gmail.com",mSubject,mMsg);
SmtpClient mySmtpClient = new SmtpClient("smtp.gmail.com",587);
mySmtpClient.Credentials = ICredentialsByHost)CredentialCache.DefaultNetworkCredentials;
mySmtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
mySmtpClient.UseDefaultCredentials = true;
mySmtpClient.EnableSsl = true;
mySmtpClient.Send(message);
}
catch (FormatException ex)
{
MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (SmtpException ex)
{
MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
}