Hi @Mansour_Dalir ,
If you want to access the right result, you need to make trade-offs after each split, not at the last one.
Function MultiFinderString(BodyText As String, MultiFind As List(Of String)) As String()
Return MultiFind.Aggregate({BodyText},
Function(result, item) result.
SelectMany(Function(str) str.Split(item)).
Where(Function(str) MultiFind.IndexOf(item) = MultiFind.Count - 1 OrElse str.Contains(MultiFind(MultiFind.IndexOf(item) + 1))).
ToArray()
)
End Function
Best Regards.
Jiachen Li
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.