开发者

How this String split()[1] method work

开发者 https://www.devze.com 2023-02-18 01:47 出处:网络
I look at the String.Split() method in MSDN which is different from the above. can someone help to explain how thiswork开发者_运维百科s?

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

精彩评论

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

关注公众号