public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start)
{
CheckThreatLevel(ThreatLevel.VeryLow, "osReplaceString");
m_host.AddScriptLPS(1);
// Normalize indices (if negative).
// After normlaization they may still be
// negative, but that is now relative to
// the start, rather than the end, of the
// sequence.
if (start < 0)
{
start = src.Length + start;
}
if (start < 0 || start >= src.Length)
{
return src;
}
// Find matches beginning at start position
Regex matcher = new Regex(pattern);
return matcher.Replace(src,replace,count,start);
}