如何使用带有定界符的数组? [英] How to use array with delimiters?
问题描述
我想使用数组来获取联系人的电子邮件,以便可以大量发送电子邮件.
&我还需要使用定界符来用分号分隔每封电子邮件;
之后,我需要再次将它们重新连接为字符串,以将其存储到文本框中.
我不知道代码看起来如何.
有没有要遵循的教程或步骤,以便我可以学习如何使用数组和定界符?
我是编码的新手,因此需要紧急帮助.谢谢
I want to use array to get the contacts'' email so that I can send out the email as mass amount.
& I need to also use delimiters to separate each of the emails with a semi-colon ;
after that i need to use join them back again as a string to store it into a textbox.
I have no idea how the codes look like.
Is there any tutorials or steps to follow so that I can learn how to use array and delimiters?
I am new to codings, so urgent help is needed. Thanks
推荐答案
据我了解,需要将emailIds
存储在array
中,然后需要构建string
与emailIds
和; as delimiter.
一起使用,如果可以,则可以使用以下代码.
As I understand from the question, it is required to store theemailIds
in anarray
and then it is required to build astring
with thoseemailIds
using; as delimiter.
If it is so, then the following code can be used.
string[] emailIds = new string[] {"id1@abc.com", "id2@def.com", "name1@xyz.org"};
string emailIdsString = string.Join("; ", emailIds);
Console.WriteLine (emailIdsString);
//id1@abc.com; id2@def.com; name1@xyz.org
SQL Server不知道BOOLEAN
数据类型.请参阅可用的数据类型 [TRUE"的电子邮件,请使用以下查询:
SQL Server does not knowBOOLEAN
data type. See availible DataTypes[^] for MS SQL Server. BOOLEAN is a text!
So... If you would like to get emails wherenewsletterAgree
is set to "TRUE
", use this query:
SELECT Email
FROM Customer
WHERE newsletterAgree = 'True'
我建议您更改int
的newsletterAgree
字段的数据类型,其中
0 = False
和
-1 = TRUE
I recomend you to change the data type for newsletterAgree
field for int
, where
0 = False
and
-1 = TRUE
这篇关于如何使用带有定界符的数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!