I have some ActionScript code that splits a string using Regular Expression and lets me add content at the split location.
// AS3 Code
function formatTweetText(tweet:String ):String
{
var regUrl:RegExp = /http:\/\/\S+/g;
var _text:String = " "+ tweet + " ";
_text = _text.replace(regUrl, '<font color="#666666"> <a href="$&" target="_blank">$&</a></font>');
_text = _text.substr(1, _text.length-2);
return _text;
}
I'm trying to find the C# equivalent to the above function
What this does is give you the entire text value inserting the Replacement text where the regular expression finds a match.
For example:
var text:String = "Hello there http://www.url.com";
would turn into
var newString:String = "hello there <font color="#666666"> <a href="http://www.url.com" target="_blank">http://www.url.com</a></font>"