遇到一个过滤字符串中大小写字母的问题
在这里提出方法:(建如下代码)
string stringA = "123 QQ qqq";
if(Regex.IsMatch(stringA, "[A-Z]"))
{
Console.WriteLine(stringA.ToLower());
}
这样就可以判断大小写了,其方法也适用于数字或者特殊字符等。
我怀疑你代码写错了
char[] a = new char[10];
char[] b = new char[10];
char[] c = new char[10];
int N = 0;
int M = 0;
Console.WriteLine("请输入10个英文字母:");
for (int i = 0; i < 10; i++)
{
a[i] = Convert.ToChar(Console.ReadLine());
if (a[i] <= 122 && a[i] >= 97)
{
b[N] = a[i];
N++;
}
else if (a[i] <= 90 && a[i] >= 65)
{
c[M] = a[i];
M++;
}
}
Console.WriteLine(b);
Console.WriteLine(c);
Console.ReadLine();