All pastes #253478 Raw Edit

Anonymous

public text v1 · immutable
#253478 ·published 2006-11-20 20:19 UTC
rendered paste body
        public string FormatVars(string text)
        {
            Regex r = new Regex("~(.+?)~");
            MatchCollection mC = r.Matches(text);

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