Rob*_*tea 5 php c# asp.net replace strtr
需要将此 php 代码转换为 C#
strtr($input, '+/', '-_')
Run Code Online (Sandbox Code Playgroud)
是否存在等效的 C# 函数?
该PHP方法strtr()是翻译方法而不是string replace方法。如果您想执行相同的操作,C#请使用以下命令:
根据您的评论
string input = "baab";
var output = input.Replace("a", "0").Replace("b","1");
Run Code Online (Sandbox Code Playgroud)
注意:没有
strtr()与 中完全相同的方法C#。
您可以在此处找到有关 String.Replace 方法的更多信息
| 归档时间: |
|
| 查看次数: |
1658 次 |
| 最近记录: |