fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var operators = new Dictionary<string, string>();
  10. operators.Add("plus", "x");
  11. var s = "5 somerandom text that needs to be removed * 3".Where(c => operators.ContainsValue(c.ToString()) || double.TryParse(c.ToString(), out new double())).ToArray();
  12. string NotInDictionary = new string(s);
  13. Console.WriteLine(NotInDictionary);
  14. }
  15. }
Compilation error #stdin compilation error #stdout 0.03s 33848KB
stdin
Standard input is empty
compilation info
prog.cs(11,144): error CS1510: A ref or out argument must be an assignable variable
prog.cs(11,117): error CS1502: The best overloaded method match for `double.TryParse(string, out double)' has some invalid arguments
/usr/lib/mono/2.0/mscorlib.dll (Location of the symbol related to previous error)
prog.cs(11,117): error CS1503: Argument `#2' cannot convert `object' expression to type `double'
prog.cs(11,1): error CS0825: The contextual keyword `var' may only appear within a local variable declaration
prog.cs(12,37): error CS0841: A local variable `s' cannot be used before it is declared
prog.cs(12,26): error CS1502: The best overloaded method match for `string.String(char*)' has some invalid arguments
/usr/lib/mono/2.0/mscorlib.dll (Location of the symbol related to previous error)
prog.cs(12,26): error CS1503: Argument `#1' cannot convert `object' expression to type `char*'
Compilation failed: 7 error(s), 0 warnings
stdout
Standard output is empty