Java Hex Convert To fromHex(String hex)

Here you can find the source of fromHex(String hex)

Description

Returns the integer value of an hexadecimal number (base 16).

License

Open Source License

Parameter

Parameter Description
hex the hex value to be parsed into an integer

Return

the given hex value as integer

Declaration

public static final int fromHex(String hex) 

Method Source Code

//package com.java2s;
/**//  ww  w. jav  a  2 s .c o  m
 * Copyright (c) 2010-2016, openHAB.org and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */

public class Main {
    /**
     * Returns the integer value of an hexadecimal number (base 16).
     * 
     * @param hex
     *            the hex value to be parsed into an integer
     * @return the given hex value as integer
     */
    public static final int fromHex(String hex) {
        return Integer.parseInt(hex, 16);
    }
}

Related

  1. fromHex(String bytesString)
  2. fromHex(String encoded)
  3. fromHex(String hex)
  4. fromHex(String hex)
  5. fromHex(String hex)
  6. fromHex(String hex)
  7. fromHex(String hex)
  8. fromHex(String hex)
  9. fromHex(String hex)