Java) 문자를 아스키코드 숫자로 변환

Dzeko·2021년 9월 24일
0

개발일지

목록 보기
18/108
import java.nio.charset.StandardCharsets;

public class Main {
    public static void main(String[] args) {

        String s = "b";
        byte[] bytes = s.getBytes(StandardCharsets.US_ASCII);
        System.out.println("ASCII Numeric Value: "+bytes[0]);

    }
}
profile
Hound on the Code

0개의 댓글