All pastes #1837684 Raw Edit

SelfPrint.cs

public text v1 · immutable
#1837684 ·published 2010-03-13 18:23 UTC
rendered paste body
using System;
class Program 
{ 
    static void Main() 
    {
        string[] texts = new string[]
        {
            "using System;",
            "class Program",
            "{",
            "    static void Main()",
            "    {",
            "        string[] texts = new string[]",
            "        {",
            "        };",
            "        int i = 0;",
            "        foreach (string text in texts)",
            "        {",
            "            Console.WriteLine(text);",
            "            i++;",
            "            if (i == 7)",
            "            {",
            "                foreach (string item in texts)",
            "                {",
            "                    string s = item.Replace(\"\\\\\", \"\\\\\\\\\");",
            "                    s = s.Replace(\"\\\"\", \"\\\\\\\"\");",
            "                    s = \"            \\\"\" + s + \"\\\",\";",
            "                    Console.WriteLine(s);",
            "                }",
            "            }",
            "        }",
            "    }",
            "}",
        };
        int i = 0;
        foreach (string text in texts)
        {
            Console.WriteLine(text);
            i++;
            if (i == 7)
            {
                foreach (string item in texts)
                {
                    string s = item.Replace("\\", "\\\\");
                    s = s.Replace("\"", "\\\"");
                    s = "            \"" + s + "\",";
                    Console.WriteLine(s);
                }
            }
        }
    }
}