I have a code like this:
StringBuilder systemConditi开发者_如何学运维on = new StringBuilder();
systemCondition.Append("^(");
systemCondition.Append(Regex.Escape(this.Class));
systemCondition.Append(" : ");
systemCondition.Append(Regex.Escape(this.Instance));
systemCondition.Append(")$");
m_afc.QualifiedInstanceFilter = systemCondition.ToString();
Can any body tell me whats wrong here? Then what about this code
If you just want more elegant code in one line, why not this?
m_afc.QualifiedInstanceFilter = string.Format("^({0} : {1})$", Regex.Escape(this.Class), Regex.Escape(this.Instance));
精彩评论