How can I remove the spaces, tabs, new lines between characters using c#'s REGEX?

夙愿已清 提交于 2019-12-01 13:55:40

Why don't you use:

XDocument xdoc = XDocument.Load(filename);
xdoc.Save(filename, SaveOptions.DisableFormatting);

it will remove all the formatting in your xml document. See SaveOptions.DisableFormatting for more details.

I guess you best shot is to get all the information between the < and />.

<[^>]*/>

Then you can do the replace on that matched part of the xml with the replace all of your language.

( |\n|\t) to be replaced by ""
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!