本文整理汇总了C#中System.Text.RegularExpressions.Regex.ToUpperInvariant方法的典型用法代码示例。如果您正苦于以下问题:C# Regex.ToUpperInvariant方法的具体用法?C# Regex.ToUpperInvariant怎么用?C# Regex.ToUpperInvariant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Text.RegularExpressions.Regex
的用法示例。
在下文中一共展示了Regex.ToUpperInvariant方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Save
public void Save(CGenerator cGenerator)
{
CFile cFile = new CFile();
cFile.AddElement(new Comment("Generated by LwipMibCompiler"));
cFile.AddElement(EmptyLine.SingleLine);
string headerDefine = cGenerator.FileName;
headerDefine = new Regex("[^a-zA-Z0-9]").Replace(headerDefine, "_");
headerDefine = headerDefine.ToUpperInvariant();
CodeContainerBase e = cFile.AddElement(new PP_Ifdef(headerDefine, inverted: true)) as CodeContainerBase;
e.AddElement(new PP_Macro(headerDefine, headerDefine));
e.AddElement(EmptyLine.SingleLine);
e.AddElement(new PP_Include(LwipDefs.Incl_SnmpOpts));
e = e.AddElement(new PP_If(LwipDefs.Opt_SnmpEnabled)) as CodeContainerBase;
e.AddElement(EmptyLine.SingleLine);
CodeContainerBase cplusplusopen = e.AddElement(new PP_Ifdef("__cplusplus")) as CodeContainerBase;
cplusplusopen.AddElement(new Code("extern \"C\" {"));
e.AddElement(EmptyLine.SingleLine);
if (this.includes.Count > 0)
{
e.AddElements(this.includes);
e.AddElement(EmptyLine.SingleLine);
}
if (this.defines.Count > 0)
{
e.AddElements(this.defines);
e.AddElement(EmptyLine.SingleLine);
}
e.AddElements(this.functionDeclarations, EmptyLine.SingleLine);
e.AddElements(this.variableDeclarations, EmptyLine.SingleLine);
e.AddElement(EmptyLine.SingleLine);
CodeContainerBase cplusplusclose = e.AddElement(new PP_Ifdef("__cplusplus")) as CodeContainerBase;
cplusplusclose.AddElement(new Code("}"));
e.AddElement(EmptyLine.SingleLine);
cFile.Save(cGenerator);
}