Java Hex Calculate toHexString(String s)

Here you can find the source of toHexString(String s)

Description

to Hex String

License

Apache License

Declaration

public static String toHexString(String s) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String toHexString(String s) {
        String str = "";
        for (int i = 0; i < s.length(); i++) {
            int ch = s.charAt(i);
            String s4 = Integer.toHexString(ch);
            str = str + s4;//from  w  ww.j a  v a  2 s. c  o  m
        }
        return str;
    }
}

Related

  1. toHexString(long value, int digits)
  2. toHexString(long value, int digits)
  3. ToHexString(long[] data)
  4. toHexString(String data)
  5. toHexString(String input)
  6. toHexString(String s)
  7. toHexString(String s)
  8. toHexString(String str)
  9. toHexString(String str)