拆分电子邮件地址以返回姓氏,名字 - 剥离'@' [英] split email address to return last name,first name-strip off '@'
本文介绍了拆分电子邮件地址以返回姓氏,名字 - 剥离'@'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
   var email =(string)Dts.Variables [" User :: Email"]。Value;
  ; var user = email.Split(new char [] {'。'},StringSplitOptions.RemoveEmptyEntries);
  var userString = string.Format(" {0},{1}",user [1],user [0]);
var email = (string)Dts.Variables["User::Email"].Value;
var user = email.Split(new char[]{'.'},StringSplitOptions.RemoveEmptyEntries);
var userString = string.Format("{0},{1}", user[1], user[0]);
以上商店:user [1]: dave @gmail用户[0]:john
The above stores: user[1]:dave@gmail user[0]:john
电子邮件是:john.dave@gmail.com
Email is: john.dave@gmail.com
输出应该是dave,john
Output should be dave,john
推荐答案
使用
MailAddress 。将整个字符串传递给构造函数,然后使用属性获取所需的信息。
Use MailAddress for this. Pass the entire string to the constructor and then use the properties to get the information you want.
这篇关于拆分电子邮件地址以返回姓氏,名字 - 剥离'@'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文