Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How this String split()[1] method work

Tags:

c#

I look at the String.Split() method in MSDN which is different from the above. can someone help to explain how this works?

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

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

like image 526
MilkBottle Avatar asked Jul 27 '26 22:07

MilkBottle


1 Answers

String.Split returns an array.

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

like image 138
SLaks Avatar answered Jul 30 '26 12:07

SLaks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!