this code is working, however the print out want to be 2+2.BigInteger PowerOfTwo = BigInteger.valueOf(2); DecimalToBinary = new BigInteger(LargeBase.getText()); String binaryString = DecimalToBinary.toString(2); int binaryNo = Integer.parseInt(binaryString, 2); String backTOString = Integer.toBinaryString(binaryNo); char[] binaryArray = backTOString.toCharArray(); int FristCount=0;int SecCount=0; for (char c : binaryArray){ if(c == 49){ // int i=c; will convter to ascii, so 1=49, 0=48. display.setText(display.getText()+" "+PowerOfTwo+"^"+FristCount+" + ");} FristCount++; }
However the print out come as 2+2+.
How to earse the last part of +
so come it will cone out like 2+2.