MCPcopy Create free account
hub / github.com/apache/commons-lang / isHex

Method isHex

src/main/java/org/apache/commons/lang3/CharUtils.java:272–274  ·  view source on GitHub ↗

Tests whether a character is a hexadecimal character. CharUtils.isHex('0') = true CharUtils.isHex('3') = true CharUtils.isHex('9') = true CharUtils.isHex('a') = true CharUtils.isHex('f') = true CharUtils.isHex('g') = false CharUtils.isHex('A') = true CharUtils.isHex('F'

(final char ch)

Source from the content-addressed store, hash-verified

270 * @since 3.18.0
271 */
272 public static boolean isHex(final char ch) {
273 return isAsciiNumeric(ch) || ch >= 'a' && ch <= 'f' || ch >= 'A' && ch <= 'F';
274 }
275
276 /**
277 * Tests whether a character is a hexadecimal character.

Callers 2

testIsHex_intMethod · 0.95
translateMethod · 0.95

Calls 1

isAsciiNumericMethod · 0.95

Tested by 1

testIsHex_intMethod · 0.76