OpenSim.Region.ScriptEngine.Shared.Api.OSSL_Api.osReplaceString C# (CSharp) Method

osReplaceString() public method

public osReplaceString ( string src, string pattern, string replace, int count, int start ) : OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString
src string
pattern string
replace string
count int
start int
return OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString
        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);
        }
OSSL_Api