Examples
Here are some examples.
Example 1:
Suppose you want to parse a character sequence "332" in radix 8. To extract the unsigned long value from this character sequence, start index is 0 and end index is 1. Here is the example code:
CharSequence s1 = "332";
int beginIndex = 0;
int endIndex = 1;
int radix = 8;
long res1 = Long.parseUnsignedLong(s1, beginIndex, endIndex, radix);
System.out.println("Unsigned Value: "+res1);
Output:
Unsigned Value: 3
Example 2:
Suppose you want to parse a character sequence "ABCDEF" in radix 16. To extract the unsigned long value from this character sequence, start index is 1 and end index is 6. Here is the example code:
CharSequence s1 = "ABCDEF";
int beginIndex = 1;
int endIndex = 6;
int radix = 16;
long res1 = Long.parseUnsignedLong(s1, beginIndex, endIndex, radix);
System.out.println("Unsigned Value: "+res1);
Output:
Unsigned Value: 11259375