Cyotek.Web.BbCodeFormatter/SearchReplaceFormatter.cs
Download
cyotek.web.bbcodeformatter.zip
(7.12 KB | 18 March 2010 )
A simple to use class library for converting text containing BBCode used by popular forum systems into HTML using C#.
Donate
If this site or its services have saved you time, please consider a donation to help with running costs and timely updates.
Contents of cyotek.web.bbcodeformatter.zip/Cyotek.Web.BbCodeFormatter/SearchReplaceFormatter.cs
namespace Cyotek.Web.BbCodeFormatter
{
internal class SearchReplaceFormatter : IHtmlFormatter
{
#region Private Member Declarations
private string _pattern;
private string _replace;
#endregion Private Member Declarations
#region Public Constructors
public SearchReplaceFormatter(string pattern, string replace)
{
_pattern = pattern;
_replace = replace;
}
#endregion Public Constructors
#region Public Methods
public string Format(string data)
{
return data.Replace(_pattern, _replace);
}
#endregion Public Methods
}
}
