-2

我有一个字符串

<span id="lblEnt" class="selected">Enterprise</span>
<span id="lblDept" class="selected">Department</span>

我需要提取子字符串“企业”和“部门”,或者可能从“<”和“>”中删除字符

4

1 回答 1

4

干得好:

var s = @"<span id=""lblEnt"" class=""selected"">Enterprise</span>
<span id=""lblDept"" class=""selected"">Department</span>";

var t = Regex.Replace(s, @"<[^>]+>", "");
于 2013-10-24T11:20:35.313 回答