fork(1) download
  1. using static System.Console;
  2.  
  3. public class Program {
  4. public static void Main() {
  5. var texto = "Abcc111de12234";
  6. var lista = new char[texto.Length];
  7. for (int i = 0, j = 0; i < texto.Length; i++) if (!char.IsDigit(texto[i]) || (i == 0 || texto[i] != texto[i - 1])) lista[j++] = texto[i];
  8. WriteLine(new string(lista));
  9. }
  10. }
  11.  
  12. //https://pt.stackoverflow.com/q/291742/101
Success #stdin #stdout 0.02s 15892KB
stdin
Standard input is empty
stdout
Abcc1de1234