【发布时间】:2022-01-10 07:44:48
【问题描述】:
我得到像“thetaetaA”这样的字符串(theta eta A) 我需要替换收到的字符串,例如 {\theta}{\eta}A
// C# code with regex to match greek letters
string gl = "alpha|beta|delata|theta|eta";
string recived = "thetaetaA";
var greekLetters = Regex.Matches(recived,gl);
有人可以告诉我如何创建所需的文本 {\theta}{\eta}A
如果我使用循环并替换它会生成以下输出
{\th{\eta}}{\eta}A
因为 theta 包含 eta
【问题讨论】: