Marius Vasile

Marius Vasile

  • 594
  • 1.9k
  • 144.8k

asp.net core split a string in two strings

Jan 19 2021 6:14 PM
Ok, my next challenge is to split a string into two other strings. I  see how to split a string but how do I get the two string separately
 
string test = Mercedez-Benz
string[] testSplit= test.Split("- "); 
 
but now, how do I get
 
string1 = Mercedez;
string2 = Benz;
 
What if string2 is int? Can I transform it to int with Int32.Parse? 

Answers (5)