Package org.apache.lucene.util
Class StringHelper
- java.lang.Object
 - 
- org.apache.lucene.util.StringHelper
 
 
- 
public abstract class StringHelper extends java.lang.ObjectMethods for manipulating strings. 
- 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intbytesDifference(BytesRef left, BytesRef right)Compares twoBytesRef, element by element, and returns the number of elements common to both arrays.static booleanendsWith(BytesRef ref, BytesRef suffix)Returnstrueiff the ref ends with the given suffix.static booleanequals(java.lang.String s1, java.lang.String s2)static java.util.Comparator<java.lang.String>getVersionComparator()static booleanstartsWith(BytesRef ref, BytesRef prefix)Returnstrueiff the ref starts with the given prefix. 
 - 
 
- 
- 
Method Detail
- 
bytesDifference
public static int bytesDifference(BytesRef left, BytesRef right)
Compares twoBytesRef, element by element, and returns the number of elements common to both arrays. 
- 
getVersionComparator
public static java.util.Comparator<java.lang.String> getVersionComparator()
- Returns:
 - a Comparator over versioned strings such as X.YY.Z
 
 
- 
equals
public static boolean equals(java.lang.String s1, java.lang.String s2) 
- 
startsWith
public static boolean startsWith(BytesRef ref, BytesRef prefix)
Returnstrueiff the ref starts with the given prefix. Otherwisefalse.- Parameters:
 ref- theBytesRefto testprefix- the expected prefix- Returns:
 - Returns 
trueiff the ref starts with the given prefix. Otherwisefalse. 
 
 - 
 
 -