All pastes #253474 Raw Edit

Anonymous

public text v1 · immutable
#253474 ·published 2006-11-20 20:15 UTC
rendered paste body
        public string FormatVars(string text)
        {
            Regex r = new Regex("~(.+?)~");
            //text = r.Replace(text, "{0}");

            MatchCollection mC = r.Matches(text);

            for (int i = 0; i < mC.Count; i++)
                text = text.Replace(mC[i].ToString(), "{i}");
         
            return text;
        }