Is there a more elegant way to structure the following code, which takes a comma delimited string containing certain values in specific positions and assigns the values to the properties of an object?
// split comma delimited items into a string array
Dim items As String() = myList.Split(CChar(","))
// Assign my Person object's properties
// Name
If items.Length > 0 Then
Person.FullName = items(ItemIndex.FullName)
End If
// Address1
If items.Length > 1 Then
Person.Address1 = items(ItemIndex.Address1)
End If
// Address2
If payload.Length > 2 Then
Person.Address2 = items(ItemIndex.Address2)
End If
EDIT: I'm open to C# examples, too.