How to parse part of a character sequence in Java

1 Answer

0 votes
class Program {
    public static void main(String[] args) {
        CharSequence s = "83904";
   
        // parseInt(CharSequence s, int beginText, int endText, int radix)
        
        int n = Integer.parseInt(s, 0, 2, 10);
        
        System.out.println(n); 
    }
}



/*
run:

83

*/

 



answered Apr 7, 2024 by avibootz

Related questions

1 answer 198 views
3 answers 395 views
2 answers 96 views
96 views asked Jan 31, 2025 by avibootz
2 answers 138 views
2 answers 111 views
111 views asked Oct 8, 2023 by avibootz
1 answer 153 views
153 views asked Mar 24, 2021 by avibootz
...