+ 3
C# - What's the value of "str"? Why its length is 5?
var str = "-Solo--Learn-".Split('-'); Console.WriteLine(str); Console.WriteLine(str.Length);
5 Answers
+ 6
Have a look at this sample code I made.
https://code.sololearn.com/c2l7kyZud915
I think you are confused, because str is not a string
+ 7
["", "Solo", "", "Learn", ""]
Imagine the opposite operation: joining all the array elements with a "-".
+ 2
Having a hard time wrapping my head around the split method :)
+ 2
Thanks sneeze !
+ 1
sneeze this is wonderful, thank you!