Need to convert this php code in C#
strtr($input, '+/', '-_')
Does an equivalent C# function exist?
The PHP
method strtr()
is translate method and not string replace
method.
If you want to do the same in C#
then use following:
As per your comments
string input = "baab";
var output = input.Replace("a", "0").Replace("b","1");
Note : There is no exactly similar method like
strtr()
inC#
.