Here's a better fit version...
Code:Dim l As New List(Of String)(New String() {"* This is a short one.", _ "* Another short one.", _ "* This is a very long one", _ "spanning a whopping", _ "three lines.", _ "* Still another.", _ "* Yet another.", _ "* Back to a short one.", _ "* And another short one.", _ "* Last one here."}) Dim count As Integer = l.Where(Function(sentence) sentence.StartsWith("*")).Count Dim f As Integer = count \ 2 Do If (l(f).StartsWith("*") And l(f + 1).StartsWith("*")) Then Exit Do Else If l(f).EndsWith(".") Then Exit Do Else If l(f + 1).EndsWith(".") Then f += 1 Exit Do Else f += 1 End If End If End If If f = l.Count Then Exit Do Loop Dim firstList As List(Of String) = l.Take(f + 1).ToList Dim secondList As List(Of String) = l.Skip(f + 1).ToList




Reply With Quote