gpt4 book ai didi

c# - 将 VB.net 替换转换为 C#

转载 作者:行者123 更新时间:2023-11-30 13:57:21 27 4
gpt4 key购买 nike

我想将此 VB.net 片段转换为 C#

sURL = Replace(sURL,"%F9","%C3%B9",,,CompareMethod.Text)

哪一个更好?

sURL = Strings.Replace(sURL,"%F3","%C3%B3", 1, -1, CompareMethod.Text);
sURL = Regex.Replace(sURL,"%FA","%C3%BA",CompareMethod.Text);

最佳答案

Regex replace用于 Regular expressions .这里没有正则表达式,所以最好使用通常的替换:

sURL = sURL.Replace("%F3","%C3%B3");

关于c# - 将 VB.net 替换转换为 C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21630862/

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