开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜