Encuentre y reemplace cada tercer carácter en una cadena determinada y reemplácelo con H
Encontré este código Javascript que hace lo mismo y me gustaría convertirlo en un código C#. ¿Puedes por favor ayudar?
Encontrado aquí
str = str.replace(/((?:[^x]*x){2}[^x]*)x/g, '$1y'); let str = 'I amx nexver axt hoxme on Sxundxaxs'; let n = 3; let ch = 'x'; let regex = new RegExp("((?:[^" +ch+ "]*" +ch+ "){" + (n-1) + "}[^" +ch+ "]*)" +ch, "g"); str = str.replace(regex, '$1y'); console.log(str); //=> I amx nexver ayt hoxme on Sxundyaxs