addHexPrefix function

String addHexPrefix(
  1. String str
)

Adds "0x" to a given String if it does not already start with "0x".

Implementation

String addHexPrefix(String str) {
  return utils.isHexPrefixed(str) ? str : '0x' + str;
}