1
Vote

StringJuggler - Multiple email addresses on same line

description

If there is plain text which contains the same email address several times:
From: email@gmail.com [email@gmail.com]   The StringJuggler's AutoHyperlinks will not produce the proper result. This is because for every match it is replacing the email with a mailto link, so it'll perform string.Replace twice for the same string.
 
I fixed this by taking out the for loop and using regex.Replace instead, like this:
final = regex.Replace(final, "<a href=\"mailto:$1\">$1</a>");

comments