小编Orb*_*ter的帖子

C#Regex - 替换为自身

想要以编程方式使用HTML标记格式化文章.在文章中找到模式并将其自身替换为每侧附加的标签的最佳方法是什么?更具体地说,我如何thematch在以下示例中传递匹配:

string formattedArticle
    = Regex.Replace(article, "^\d.+", "<em>" + thematch + "</em>");
Run Code Online (Sandbox Code Playgroud)

c# regex replace

2
推荐指数
1
解决办法
1898
查看次数

Java - 比较值数组

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)

是否有更简单的方法来比较这些字符串而不使用循环?

java arrays compare

1
推荐指数
1
解决办法
6218
查看次数

标签 统计

arrays ×1

c# ×1

compare ×1

java ×1

regex ×1

replace ×1