fork download
  1. using static System.Console;
  2.  
  3. public class Program {
  4. public static void Main() {
  5. var texto = "(99) 9999-9999";
  6. WriteLine(texto.Replace(new string[] {"(", ")", "-", " " }, ""));
  7. }
  8. }
  9.  
  10. public static class StringExt {
  11. public static string Replace(this string str, string[] separators, string newValue) {
  12. foreach (var chr in separators) str = str.Replace(chr, newValue);
  13. return str;
  14. }
  15. }
  16.  
  17. //https://pt.stackoverflow.com/q/98332/101
Success #stdin #stdout 0.02s 16152KB
stdin
Standard input is empty
stdout
9999999999