Here’s a short way to convert it to hex:
public String toHex(String arg) {
return String.format("%040x", new BigInteger(1, arg.getBytes(/*YOUR_CHARSET?*/)));
}
More Related Contents:
- How to convert a color integer to a hex String in Android?
- How to convert hex string to Java string?
- Java converting int to hex and back again
- Convert a String of Hex into ASCII in Java
- Verify if String is hexadecimal
- How to convert hex string to float in Java?
- Compare two hex strings in Java?
- implement length() of string without using Built-in functions [closed]
- How to split strings based on "/n" in Java [closed]
- How to store a string array inside a string in java
- Can I product of charAt in Java? [duplicate]
- How to capitalize the first character of each word in a string
- How to enter quotes in a Java string?
- Comparing strings with == which are declared final in Java
- Android Split string
- String comparison and String interning in Java
- Simple way to count character occurrences in a string [duplicate]
- Is it better practice to use String.format over string Concatenation in Java?
- How to convert/parse from String to char in java?
- Using Locales with Java’s toLowerCase() and toUpperCase()
- How to upper case every first letter of word in a string? [duplicate]
- Java String.split() Regex
- How can I invert the case of a String in Java?
- How can I start a new android activity using class name in a string?
- Remove Null Value from String array in java
- comparison of two Strings doesn’t work in android [duplicate]
- Exact difference between CharSequence and String in java [duplicate]
- How to check whether given string is a word
- Parse Date from String in this format : dd/MM/yyyy [to dd/MM/yyyy]
- How many Java objects are generated by this – new String(“abcd”)