gpt4 book ai didi

c# - 仅某些字符的正则表达式

转载 作者:太空宇宙 更新时间:2023-11-03 15:33:13 24 4
gpt4 key购买 nike

我有这段文字:

33113 1;3;\"windlight \"\"Feeling\"\"\r\nmetal, handmade\r\ninside: gold
metallic\r\noutisde: anthracite brushed\r\nH. 14 cm - B. 11,5
cm\";7,95;4001250331131;218,625;262,35;579;21;0004;0001;KUS\r\n

这个正则表达式:

;\\"[^;]*\\";

结果是:

;\"windlight \"\"Feeling\"\"\r\nmetal, handmade\r\ninside: gold metallic\r\noutisde: anthracite brushed\r\nH. 14 cm - B. 11,5 cm\";

我想删除换行符的地方 \r\n。请问您有什么想法吗?

我需要这样的东西:

var replaced = Regex.Replace( 
"a regex pattern which removes \r\n from the selected text", " ");

这是我要从文本中删除的内容: http://postimg.org/image/5hbtd1czx/

最佳答案

例如,

 String str = "Text contains \r \n string here";
str = str.Replace("(\r\n", " "); // with blank space

关于c# - 仅某些字符的正则表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32985997/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com