小编Tel*_*sch的帖子

如何替换部分未知字符串


我需要替换(或更好地删除)字符串,在此我知道开始和结束。
有些字符是未知的,字符串的长度也是未知的。
当然,我可以使用子字符串和其他c#字符串操作,但是没有简单的替换通配符选项吗?

mystring.Replace("O(*)", "");
Run Code Online (Sandbox Code Playgroud)

Would be a nice Option.
I know that the string Begins with O( and Ends with ).
It's possible than the String Looks like O(something);QG(anything else)
Here the result should be ;QG(anything else)

Is this possible with a simple replace?
And what About the advanced Option, that he string exists more than one time like here:
O(something);O(someone);QG(anything else)

c# string-operations

1
推荐指数
1
解决办法
42
查看次数

标签 统计

c# ×1

string-operations ×1