Literal character in C#
I want 开发者_开发百科to compile my C# code. I was parsing a string by "....",
string[] parts = line.Split(new[] { '....' }, 2);
Then I got an error:
Too many characters in character literal
The line looks like this:
abc.... starting word in english
I think that I need to convert .... to =. Then everything would work fine. Is there any other way?
You can only split by char by passing a single character: '.'.
Split using string instead:
string[] parts = line.Split("....", 2);
Try using the Split method:
string[] parts = line.Split("....", 2, StringSplitOptions.None);
加载中,请稍侯......
精彩评论