我正在尝试更改我在 mvc 编辑中使用 c# 的文本
我使用了以下代码,但出现错误
“字符太多......”。
这是我正在使用的代码:
public async Task<ActionResult> Edit([Bind(Include = "AboutId,AboutHeader,AboutText,PicAlt,Url")] About about)
{
about.AboutText = about.AboutText.Replace('{font-family: "Guttman Calligraphic"; font-size: 12pt; mso-ascii-font-family: David; mso-fareast-font-family: MingLiU-ExtB; mso-hansi-font-family: David;}, "")');
if (ModelState.IsValid)
{
thanks
您使用了不正确的覆盖Replace
你需要使用这个:
about.AboutText = about.AboutText.Replace("{font-family: \"Guttman Calligraphic\"; font-size: 12pt; mso-ascii-font-family: David; mso-fareast-font-family: MingLiU-ExtB; mso-hansi-font-family: David;}","");
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)