public static string AppendRule(string?input, StylesheetRule rule) { var contents = input; contents += Environment.NewLine + Environment.NewLine + rule; return(contents); }
public static string ReplaceRule(string input, string oldRuleName, StylesheetRule rule) { var contents = input; var ruleRegex = new Regex(string.Format(RuleRegexFormat, oldRuleName.EscapeRegexSpecialCharacters()), RegexOptions.IgnoreCase | RegexOptions.Singleline); contents = ruleRegex.Replace(contents, rule != null ? rule.ToString() : ""); return(contents); }