C#怎么让重复字母去除。
static void Main(string[] args)
{
string str = "cvbd56#%CAV";
char c;
int a = 0;
for (int i= 0; iConsole.WriteLine();
if(( c>='a'&& c<='z' )||(c>='A' && c<='Z'))
{
a++;
}
}
Console.WriteLine("{0}", a);
Console.ReadKey();
```
string str = "cvbd56#%CAV";
str = string.Join("", str.Distinct().Select(x => x.ToString()).ToArray());
Console.WriteLine(str);
//如果你要统计字母个数,可以
int alphacont = str.ToLower().Where(x => x >= 'a' && x <= 'z').Count();
Console.WriteLine(alphacont.ToString());
我也没看出你的代码要去重啊,你的代码想干什么?
不知道你这个问题是否已经解决, 如果还没有解决的话:项目需要,要进行某文件夹下所有shp数据的读取