Package ghidra.util
Class StringFormat
java.lang.Object
ghidra.util.StringFormat
Class with static methods formatting values in hex.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
hexByteString
(byte b) Gets a hexadecimal representation of a byte value.static String
hexWordString
(short s) Gets a hexadecimal representation of a short value.static String
Creates a string prepended with zeros, if padding is indicated, and adds the indicated endchar as the suffix.
-
Method Details
-
hexByteString
Gets a hexadecimal representation of a byte value.- Parameters:
b
- the byte value- Returns:
- the byte as a hexadecimal string.
-
hexWordString
Gets a hexadecimal representation of a short value.- Parameters:
s
- the short value- Returns:
- the short as a hexadecimal string.
-
padIt
Creates a string prepended with zeros, if padding is indicated, and adds the indicated endchar as the suffix.- Parameters:
str
- the original stringpadlen
- length of the padded string without the suffix character.endchar
- the suffix characterpadded
- if true then prepend with zeros- Returns:
- return the possibly padded string containing the suffix.
-