SHARE
TWEET

Bad Code Coding Challenge #31

a guest Feb 27th, 2020 224 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static String number_Format(String n, String f) {
  2.     char[] nArr = n.toCharArray();
  3.     char[] fArr = f.toCharArray();
  4.     int i = 0;
  5.     int j = 0;
  6.     while (i < fArr.length && j < nArr.length) {
  7.         if (fArr[i] == '#') {
  8.             fArr[i] = nArr[j];
  9.             j++;
  10.         }
  11.         i++;
  12.     }
  13.     i = 0;
  14.     String r = "";
  15.     while (i < fArr.length) {
  16.         r = r + fArr[i++];
  17.     }
  18.     return r;
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top