最好的方法“更少的时间”使用实体框架插入批量插入,不包括两个相干表的重复记录?-英雄云拓展知识分享
323
2024-01-22
我已声明了一个字符串数组,我想与用户给出的名称进行比较,
string[] MasterList = new string[] {"Askay", "Puram", "Raman", "Srinivasa",
"Gopal", "Rajesh", "Anju", "Nagara",
};
string YourName;
Console.WriteLine("Enter your name: ");
YourName = Console.ReadLine();

for(i=0; i<5; i++)
{
a = String.Compare(MasterList[i], YourName);
Console.WriteLine("Your name is not among the list")
}
终究的输出不是我所期望的,有甚么想法我该怎样做?
bool found = false;foreach (string s in MasterList)
{
if(s == YourName)
found = true;
}
if(found)
Console.WriteLine("Your name is among the list");
else
Console.WriteLine("Your name is not among the list");
免责声明:
本网址(www.yingxiongyun.com)发布的材料主要源于独立创作和网友匿名投稿。此处提供的所有信息仅供参考之用。我们致力于提供准确且可信的信息,但不对材料的完整性或真实性作出任何保证。用户应自行验证相关信息的正确性,并对其决策承担全部责任。对于由于信息的错误、不准确或遗漏所造成的任何损失,本网址不承担任何法律责任。本网站所展示的所有内容,如文字、图像、标志、音频、视频、软件和程序等的版权均属于原创作者。如果任何组织或个人认为网站内容可能侵犯其知识产权,或包含不准确之处,请即刻联系我们进行相应处理。
发表评论
暂时没有评论,来抢沙发吧~