1
Format = PPYYMMNNNN
我只需要知道如何只计算字母N. 我发现的例子是计算所有的字母。 我已经尝试了一些代码,但不工作,我不知道错误在哪里。如何计算文本框中的值?
format = docctrlTable.format;
int count = 0;
for (int i = 0; i < format.Length; i++)
{
String a = format[i] + "";
if (a.Equals("N"))
{
count = count + 1;
}
}
return count;
什么是错误您收到? – Kinetic
如果我只将格式更改为PPYYMMNN 2 N,它仍然会得到4 n – David
嗯,它适用于我! – Kinetic