title: Shows specific digit of the output // deleting 0's from bigInteger
body: <p>How could I show only specific digit of an output?
  How could I delete 0's from a bigInteger?</p>
  
  <p>My Example:</p>
  
  <p>Having a task to show number's factorial's last number that isn't 0.</p>
  
  <pre><code>Example:
  1! = 1
  2! = 2
  3! = 6
  4! = 4
  5! = 2
  6! = 2
  </code></pre>
  
  <p>Right now it just shows factorial.</p>
  
  <pre><code>import java.math.BigInteger;
  import java.util.Scanner;
  
  public class Main{
      // Returns Factorial of N
      static BigInteger factorial(int N){
          // Initialize result
          BigInteger f = new BigInteger("1"); // Or BigInteger.ONE
  
          // Multiply f with 2, 3, ...N
          for (int i = 2; i &lt;= N; i++)
              f = f.multiply(BigInteger.valueOf(i));
  
          return f;
      }
  
      // Driver method
      public static void main(String args[]) throws Exception
      {
          Scanner scan = new Scanner(System.in);
          int n = scan.nextInt();
          System.out.println(factorial(n));
      }
  }
  </code></pre>
  
  <p>Example vol2 --> Here I need a solution to remove 0's from biginteger:</p>
  
  <pre><code>import java.math.BigInteger;
  import java.util.Scanner;
  
  public class Main{
      // Returns Factorial of N
      static BigInteger factorial(int N){
          // Initialize result
          BigInteger f = new BigInteger("1"); // Or BigInteger.ONE
  
          // Multiply f with 2, 3, ...N
          for (int i = 2; i &lt;= N; i++)
              f = f.multiply(BigInteger.valueOf(i));
  
          return f;
      }
  
      // Driver method
      public static void main(String args[]) throws Exception
      {
          Scanner scan = new Scanner(System.in);
          int n = scan.nextInt();
          BigInteger a = (factorial(n));
          BigInteger b, c;
          c = new BigInteger("10");
          b = a.mod(c);
          System.out.println(b);
          System.out.println(a);
      }
  }
  </code></pre>
  
  <p><strong>Is there an easy way to remove all 0's from a number? That would be the easiest way to fix my problem</strong></p>