gpt4 book ai didi

c# - 为什么 String.Replace 不替换任何东西?

转载 作者:行者123 更新时间:2023-11-30 20:18:40 24 4
gpt4 key购买 nike

<分区>

这是其中一个问题。基本上我卡住了。

Write a method that removes all occurrences of a string from another string:

    [Test]
public void TestExercise12()
{
Programmeren2Tests.Chapter12Test.TestExercise12(Exercise12);
}

public static string Exercise12(string strToRemove, string str)
{
strToRemove.Replace("str", "x");
return str;

}

我在这里所做的显然没有用,但我不知道在哪里搜索如何执行此操作。

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