Here you can find the source of asciify(String s)
Parameter | Description |
---|---|
String | s - The string to be converted. |
Parameter | Description |
---|---|
None | an exception |
static String asciify(String s)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w . j av a 2 s .c o m * Converts the characters in the given string to equivalent ascii value. * The string is assumed to be double quoted properly. * * @param String s - The string to be converted. * @return String - The ascii equivalent of the given string. * @throws None */ static String asciify(String s) { String temp = "\""; for (int i = 1; i < s.length() - 1; i++) temp += String.format("%2X", (int) s.charAt(i)).replace(' ', '0'); return temp + "\""; } }