Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1.     public static char[] zeroes(char[] array, int length)
  2.     {
  3.         char[] arrayWithZeroes = new char[20];
  4.         for(int i = 0; i < 20; i++)
  5.         {
  6.             if(i >= length)
  7.             {
  8.                 arrayWithZeroes[i] = '0';
  9.             }
  10.             else
  11.             {
  12.                 arrayWithZeroes[i] = array[i];
  13.             }
  14.         }
  15.  
  16.         return arrayWithZeroes;
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement