Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何删除字符<&燃气轮机;从一个带C#的句子开始?_C# - Fatal编程技术网

如何删除字符<&燃气轮机;从一个带C#的句子开始?

如何删除字符<&燃气轮机;从一个带C#的句子开始?,c#,C#,我有这句话,因为你的答案是用python标记发布的,所以我会用两种语言回复 Python: string = '<>><<>' print(string.replace('<>', '')) string='>string.Replace(“,string.Empty)这与python有什么关系?你试过什么?如果您搜索“在c#中用另一个字符串替换字符串”或“在c#中删除子字符串”,您可能会自己找到答案。这是否回答了您的问题?这回答了你的问题吗@X

我有这句话
,因为你的答案是用python标记发布的,所以我会用两种语言回复

Python:

string = '<>><<>'
print(string.replace('<>', ''))

string='>
string.Replace(“,string.Empty)
这与python有什么关系?你试过什么?如果您搜索“在c#中用另一个字符串替换字符串”或“在c#中删除子字符串”,您可能会自己找到答案。这是否回答了您的问题?这回答了你的问题吗@XDT将这一点转换为string.Substring而不是string.Replaceplus,您应该在启动新线程之前搜索StackOverFlow,因为还有其他2/3的问题需要正确的答案。对于这些问题,您应该标记为重复并继续。带答案的问题可能不会被自动清理脚本删除,但也许他是新来的,帮助别人不是犯罪。帮助是一件好事。不遵守规则是件坏事:你们冒着被否决的风险,因为重复问题的答案(已经有答案)实际上是“没用的”。你的答案很好,我会投反对票。@SilvanoH。谢谢你的回答,但在C#中它对我不起作用,它也起作用,但它没有给我一个输出
var str = "<>><<>";
var charsToRemove = new string[] { "<>", "another character you want to remove"};
foreach (var c in charsToRemove)
{
    str = str.Replace(c, string.Empty);
}
string = "<>><<>"
string.Replace("<>", string.Empty)