Converts a hex string into an int. Integer.parseInt(hex, 16) assumes the
input is nonnegative unless there is a preceding minus sign. This method
reads the input as twos complement instead, so if the input is 8 bytes
long, it will correctly restore a negative int produced by
Integer.toHexString() but not neccesarily one produced by
Integer.toString(x,16) since that method will produce a string like '-FF'
for negative integer values.
if the string is more than 16 characters long, or if any
character is not in the set [0-9a-fA-f]
Namespace: Lucene.Net.HighlightAssembly: Lucene.Net.Contrib.Highlighter (in Lucene.Net.Contrib.Highlighter.dll) Version: 2.3.2.1
Syntax
C# |
---|
public static int HexToInt( string hex ) |
Visual Basic |
---|
Public Shared Function HexToInt ( _ hex As String _ ) As Integer |
Visual C++ |
---|
public: static int HexToInt( String^ hex ) |
Parameters
- hex
- Type: System..::..String
[Missing <param name="hex"/> documentation for "M:Lucene.Net.Highlight.GradientFormatter.HexToInt(System.String)"]
Return Value
[Missing <returns> documentation for "M:Lucene.Net.Highlight.GradientFormatter.HexToInt(System.String)"]