Hi I want to split a string separated by space and of the form 1010 FirstName MidName LastName and use the integer 1010 in C# MVC4 Controller This string will be parsed to the controller from a hidden form element
var str = "1010 Firstname Midname LastName";
string[] parts = str.Split(' ');
if (parts != null)
{
int idpart = parts[0];
}
I get error can not implicitly convert type string to int
Thanks in advance
1 Answer