You need to sign in to do that
Don't have an account?
Suman Giri
How to convert binary string into integer ??
Hi,
There is a requirement for us where we receive binary string which needs to be converted into integer. We could acheive this in java with the below code:
String binaryString="00000101";
System.out.println(Integer.parseInt(binaryString, 2));
Output what we get is '5'.
Could we acheive this using Apex ?
Any pointers would be of great help.
Thanks in advance.
Regards,
Suman.H
All Answers
Hi,
In Apex, Integers do not have any method to directly convert binary to integer.
You will have to build your own logic to achieve this.