Class StringHelper
Methods for manipulating strings.
Inheritance
Inherited Members
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.dll
Syntax
public abstract class StringHelper
Fields
| Improve this Doc View SourceGOOD_FAST_HASH_SEED
Pass this as the seed to Murmurhash3_x86_32(Byte[], Int32, Int32, Int32).
Declaration
public static readonly int GOOD_FAST_HASH_SEED
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
| Improve this Doc View SourceVersionComparer
Returns a IComparer{string} over versioned strings such as X.YY.Z
Declaration
public static IComparer<string> VersionComparer { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IComparer<System.String> |
Methods
| Improve this Doc View SourceBytesDifference(BytesRef, BytesRef)
Compares two BytesRef, element by element, and returns the number of elements common to both arrays.
Declaration
public static int BytesDifference(BytesRef left, BytesRef right)
Parameters
Type | Name | Description |
---|---|---|
BytesRef | left | The first BytesRef to compare. |
BytesRef | right | The second BytesRef to compare. |
Returns
Type | Description |
---|---|
System.Int32 | The number of common elements. |
EndsWith(BytesRef, BytesRef)
Returns true
if the ref
ends with the given suffix
. Otherwise
false
.
Declaration
public static bool EndsWith(BytesRef ref, BytesRef suffix)
Parameters
Type | Name | Description |
---|---|---|
BytesRef | ref | The BytesRef to test. |
BytesRef | suffix | The expected suffix |
Returns
Type | Description |
---|---|
System.Boolean | Returns |
Equals(String, String)
Declaration
public static bool Equals(string s1, string s2)
Parameters
Type | Name | Description |
---|---|---|
System.String | s1 | |
System.String | s2 |
Returns
Type | Description |
---|---|
System.Boolean |
Murmurhash3_x86_32(BytesRef, Int32)
Returns the MurmurHash3_x86_32 hash. Original source/tests at https://github.com/yonik/java_util/.
Declaration
public static int Murmurhash3_x86_32(BytesRef bytes, int seed)
Parameters
Type | Name | Description |
---|---|---|
BytesRef | bytes | |
System.Int32 | seed |
Returns
Type | Description |
---|---|
System.Int32 |
Murmurhash3_x86_32(Byte[], Int32, Int32, Int32)
Returns the MurmurHash3_x86_32 hash. Original source/tests at https://github.com/yonik/java_util/.
Declaration
public static int Murmurhash3_x86_32(byte[] data, int offset, int len, int seed)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | |
System.Int32 | offset | |
System.Int32 | len | |
System.Int32 | seed |
Returns
Type | Description |
---|---|
System.Int32 |
StartsWith(BytesRef, BytesRef)
Returns true
if the ref
starts with the given prefix
.
Otherwise false
.
Declaration
public static bool StartsWith(BytesRef ref, BytesRef prefix)
Parameters
Type | Name | Description |
---|---|---|
BytesRef | ref | The BytesRef to test. |
BytesRef | prefix | The expected prefix |
Returns
Type | Description |
---|---|
System.Boolean | Returns |