Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个字符串
<span id="lblEnt" class="selected">Enterprise</span> <span id="lblDept" class="selected">Department</span>
我需要提取子字符串“企业”和“部门”,或者可能从“<”和“>”中删除字符
干得好:
var s = @"<span id=""lblEnt"" class=""selected"">Enterprise</span> <span id=""lblDept"" class=""selected"">Department</span>"; var t = Regex.Replace(s, @"<[^>]+>", "");