Friday 22 December 2017

how to print the ASCII value of String....

how to print the ASCII value of String,how to print the ASCII value of String in java,how to print the ASCII value of String using java,

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);
}
}

DashZin

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 comments:

Post a Comment