开发者

How this String split()[1] method work

I look at the String.Split() method in MSDN which is different from the above. can someone help to explain how this work开发者_运维百科s?

string boundary = resp.Headers["Content-Type"].Split('=')[1]; 

What is that [1] beside the .Split('=')[1] means?


String.Split returns an array.

Writing x[1], where x is an array, gets the 2nd element in the array.


string dir = "Saina*is*good girl";
string parts = dir.Split('*')[1].ToString();
Console.Write(parts);

It will return 'is' as a answer

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜