我的Main()功能中有这个.
List<Token> tokens = new List<Token>();
string path = @"\(some directories)\tokens.xml";
XDocument doc = XDocument.Load(path);
Run Code Online (Sandbox Code Playgroud)
我有这个类有几个属性.
public partial class Token
{
public Token()
{
SetURLs = new List<string>();
SetNames = new List<string>();
}
public string Name { get; set; }
public List<string> SetURLs { get; set; }
public List<string> SetNames { get; set; }
public string Color { get; set; }
public string PT { get; set; }
public string Text { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
我有这个XML文件.这是一个片段. …
我有这三个清单.
List<List<string>> tokens = new List<string>();
List<string> token = new List<string>();
List<string> sets = new List<string();
Run Code Online (Sandbox Code Playgroud)
token列表中的一个完整tokens列表.
{"<card>"",
" <name>Domri Emblem</name>",
" <set picURL="http://magiccards.info/extras/token/Gatecrash/Domri-Rade-Emblem.jpg" picURLHq="" picURLSt="">GTC</set>",
" <color></color>",
" <manacost></manacost>",
" <type>Emblem</type>",
" <pt></pt>",
" <tablerow>0</tablerow>",
" <text></text>",
" <token>1</token>",
"</card>"}
Run Code Online (Sandbox Code Playgroud)
该sets名单是这样的.
{"ARB", ..., "AVR", ..., "GTC", ..., "ZEN"}
Run Code Online (Sandbox Code Playgroud)
我想通过每一个token在tokens和删除每个字符串中token包含任何元素set.
该tokens列表包含一些token元素.一个token(比如说token1)有一个像这样的元素.
{..., " <set picURL="http://magiccards.info/extras/token/Gatecrash/Domri-Rade-Emblem.jpg" picURLHq="" picURLSt="">GTC</set>", ...}
Run Code Online (Sandbox Code Playgroud)
另一个 …