想要以编程方式使用HTML标记格式化文章.在文章中找到模式并将其自身替换为每侧附加的标签的最佳方法是什么?更具体地说,我如何thematch在以下示例中传递匹配:
string formattedArticle
= Regex.Replace(article, "^\d.+", "<em>" + thematch + "</em>");
Run Code Online (Sandbox Code Playgroud) String isoArray[] = {"020","784","004","028"};
if(!("020".equals(element[2]) || "784".equals(element[2]) || "004".equals(element[2]) || "028".equals(element[2]))){
country a = new country(element[4], element[5], element[7]);
countries.add(a);
}
Run Code Online (Sandbox Code Playgroud)
是否有更简单的方法来比较这些字符串而不使用循环?