String input = "helloj\"iojgeio\r\ngsk\\"jopri\"gj\r\negjoijisgoe\"joijsofeij\"\"\"ojgsoij\"";
这是我当前有效的代码,但是 iv 添加了一些必须在此之前运行的代码,这使得一些 '"' 拆分到另一行,从而使下面的代码变得过时,除非在某些情况下,'"' 没有放在下一行。
firstQuote = input.IndexOf("\"");
lastQuote = input.LastIndexOf("\"");
input = input.Substring(0, firstQuote) + "<span>quote" +
input.Substring(firstQuote + 1, lastQuote - (firstQuote + 1) + "quote</span>" +
input.Substring(lastQuote + 1, lines.Length - (lastQuote + 1);
我怎么能改变输入字符串
input = "helloj\"iojgeio\r\ngsk\\"jopri\"gj\r\negjoijisgoe\"joijsofeij\"\"\"ojgsoij\"";
至
input = "helloj(<span>quoteiojgeio\r\ngsk\\"jopriquote</span>gj\r\negjoijisgoe<span>quotejoijsofeijquote</span><span>quotequote</span>ojgsoijquote";