如何匹配字符串"Net Amount"(Net和Amount之间可以有任意数量的空格,包括零)与net amount?
这两个单词之间的空格可以是任何空格,两个字符串的精确匹配应该在那里.但是Net Amount(带空格的第一个字符串)可以是任何字符串的一部分,如Rate Net Amount或Rate CommissionNet Amount.
匹配应该不区分大小写.
private void Abc()
{
string first="";
ArrayList result = new ArrayList();
ArrayList secResult = new ArrayList();
foreach (string second in result)
{
if (first != null)
{
foreach (string third in secResult)
{
string target;
}
}
string target;//Here I cannot decalre it. And if I don't declare it and
//want to use it then also I cannot use it. And if it is in if condition like
//the code commented below, then there is no any complier error.
//if …Run Code Online (Sandbox Code Playgroud) 我想保持控件相对于其容器的大小和位置,例如,在表单调整大小时应保持表单中richtextbox的大小和位置.
有一个私有void btnContBalloon_Click(对象发送者,EventArgs e).我可以使这个静态,因为我想从静态方法调用它,但我不能.
是否可以将控件转换为组件或组件以控制winforms?并且可以使winforms中的按钮透明化吗?
我们如何将一个数据列从一个数据表复制到另一个数据表?我有数据表喜欢
DataTable datatable1=new DataTable();
Run Code Online (Sandbox Code Playgroud)
那个表中有四列,但我只想要一列.所以我喜欢
DataTable datatable2=new DataTable();
addressAndPhones2.Columns.Add(addressAndPhones.Columns[0].ColumnName,addressAndPhones.Columns[0].DataType);
Run Code Online (Sandbox Code Playgroud)
但这只是添加了列,但我想将该列的数据复制到datatable2.这就是我想将数据从一个数据表复制到另一个数据表的数据列.
我可以从静态方法调用(访问)非静态方法吗?就像我有静态方法如果是,怎么样?
public static void method() //like this is a static method
{
methodsec(); //from here I want to access non static method defined below
}
public void methodsec() // non static method
{
}
Run Code Online (Sandbox Code Playgroud) 如何将用户上传的文件存储到数据库中?我想将文件存储在数据库中我们该怎么做?在后端,我将 sql 与 c#.net 应用程序一起使用。
我打破的代码用于循环,而无需使用断裂等我为给定循环时below.And 我是1或2或3或任何其他人,但如果条件为真,则环将被终止,因为我如果条件为将5 true.And所以NO需要休息的需要there.Beacause我不想用休息.我已经做了这样的工作here.It.
int myCondition=0;
bool flag=false;
for(int i=0;i<5;i++)
{
if(myCondition==0)
{
flag=true;
}
if(flag)
i=5;
}
Run Code Online (Sandbox Code Playgroud)
但现在我想用foreach循环,在这种循环时,一些条件为真,那么我想打破foreach循环 code.So我该怎么办这里打破foreach循环的代码,而无需使用休息?就像在上面的for循环中一样,当条件为真时,我将i初始化为5.在foreach循环中,任何类似的东西都要做以避免中断.