摘要:空字串split的議題
split方法算是常用的基本款
但若碰到空字串時還是會傳回陣列為1的空值
若希望空字串碰到split不回傳值時
可以使用split的參數StringSplitOptions
ex: foreach (var bccMember in bccMembers.Split(splitChar,StringSplitOptions.RemoveEmptyEntries))
{
var userProfiler = ServiceHelper.GetUserBizEntityByPKFromWCF(bccMember);
mailReceiver = new EmailAddressInfo();
mailReceiver.Type = EmailAddressType.BCC;
mailReceiver.DisplayName = userProfiler.FullName;
mailReceiver.Address = userProfiler.Email;
emailAddressInfoList.Add(mailReceiver);
}