package com.dashzin.prog;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
public class AsciiOfString {
public static void main(String[] args) {
String st="Dashzin";
char ch[]=st.toCharArray();
/*for(int i=0;i<ch.length;i++){
System.out.println(AsciiOfChar(ch));
}*/
byte[] bt=st.getBytes(StandardCharsets.US_ASCII);
String ascii=Arrays.toString(bt);
System.out.println(ascii);
}
}
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
public class AsciiOfString {
public static void main(String[] args) {
String st="Dashzin";
char ch[]=st.toCharArray();
/*for(int i=0;i<ch.length;i++){
System.out.println(AsciiOfChar(ch));
}*/
byte[] bt=st.getBytes(StandardCharsets.US_ASCII);
String ascii=Arrays.toString(bt);
System.out.println(ascii);
}
}
0 comments:
Post a Comment