title: Trying to create simple js minifier, but it doesn't remove anything, even though I delete the white space
body: <p>I am trying to create a simple minifier because I am unsatisfied with the tools online. I have made a console application, but the problem is that nothing is removed, even though I split the text and remove /n and /t characters.</p>
  
  <p>I've tried different methods of removing the whitespace.</p>
  
  <pre><code>static string restrictedSymbols = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,0123456789";
  ...
  static void Compress(string command)
          {
              string[] commandParts = command.Split(' ');
  
              string text = String.Empty;
  
              try
              {
                  using (StreamReader sr = new StreamReader(commandParts[1]))
                  {
                      text = sr.ReadToEnd();
                      text.Replace("\n", "");
                      text.Replace("\t", "");
                      string formattedText = text;
  
                      string[] splitText = text.Split(' ');
                      StringBuilder sb = new StringBuilder();
                      for (int i = 0; i &lt; splitText.Length - 1; i++)
                      {
                          splitText[i].TrimStart();
                          StringBuilder tSB = new StringBuilder(splitText[i]);
                          if (splitText[i].Length &gt; 1 &amp;&amp; splitText[i + 1].Length &gt; 1)
                          {
                              int textLength = splitText[i].Length - 1;
  
                              if (restrictedSymbols.Contains(splitText[i + 1][0]) &amp;&amp; restrictedSymbols.Contains(splitText[i][textLength]))
                              {
                                  tSB.Append(" ");
                              }
                          }
  
                          sb.Append(tSB.ToString());
                      }
  
                      sb.Append(splitText[splitText.Length - 1]);
  
                      text = sb.ToString();
                      Console.WriteLine(text);
                  }    
              } catch (IOException e)
              {
                  Console.WriteLine(e.ToString());
              }
  
              if (text != String.Empty)
              {
                  try
                  {
                      using (StreamWriter stream = File.CreateText(commandParts[2] + commandParts[3]))
                      {
                          stream.Write(text);
                      }
                  }
                  catch (IOException e)
                  {
                      Console.WriteLine(e.ToString());
                  }
              }
  
              Console.WriteLine("Process Complete...");
              GetCommand();
          }
  </code></pre>
  
  <p>It should print output a minified file, but it just outputs the same exact file that I put in.</p>