|
|
//Read the text
string text = "丁丁是??人才";
//string text = System.IO.File.ReadAllText("FileContainingAllMyGameText.txt");
// Remove duplicates
Dictionary<char, bool> characters = new Dictionary<char, bool>();
foreach (char c in text)
{
characters.Add(c, true);//重??r?一行??鲥e
}
// Write XML
foreach (char c in characters.Keys)
{
Console.WriteLine("<CharacterRegion>");
Console.WriteLine(" <Start>&#{0};</Start>", (int)c);
Console.WriteLine(" <End>&#{0};</End>", (int)c);
Console.WriteLine("</CharacterRegion>");
}
base.Initialize(); |
|