Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/MixERP.Net.VCards/Helpers/VCardHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ public static class VCardHelper
{
public static string[] SplitCards(string contents)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public static (string, string) SplitCards(string contents)

{
return Regex.Split(contents, "((BEGIN:VCARD)(.*)(END:VCARD))");
var rx = new Regex("BEGIN:VCARD(?s)(.*?)END:VCARD");
var matches = rx.Matches(contents);
var cards = new string[matches.Count];

for (var i = 0; i < matches.Count; i++)
{
cards[i] = matches[i].ToString();
}

return cards;
}
}
}
}