Here you can find the source of toHexFilter(String inAscii)
Parameter | Description |
---|---|
inAscii | String |
public static String toHexFilter(String inAscii)
//package com.java2s; /*/* w w w. ja va2 s .co m*/ This package is part of Relations application. Copyright (C) 2010, Benno Luthiger This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ public class Main { /** * * @param inAscii {@link String} * @return String */ public static String toHexFilter(String inAscii) { StringBuilder out = new StringBuilder(); char[] lChars = inAscii.toCharArray(); for (int i = 0; i < lChars.length; i++) { out.append(Integer.toHexString((int) lChars[i])); if (i < (lChars.length - 1)) { out.append(" "); //$NON-NLS-1$ } } return new String(out); } }