Terrier IR Platform
2.2.1

uk.ac.gla.terrier.utility
Class StringTools

java.lang.Object
  extended by uk.ac.gla.terrier.utility.StringTools

public class StringTools
extends java.lang.Object

This class implements useful string functions


Constructor Summary
StringTools()
           
 
Method Summary
static java.lang.String normaliseEncoding(java.lang.String encodingName)
          Normalises several common encodings found, for instance in HTTP or HTML headers, into the compatible Java encoding
static int utf8_length(java.lang.String s)
          Returns how long String s is in bytes, if encoded in UTF-8
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTools

public StringTools()
Method Detail

utf8_length

public static int utf8_length(java.lang.String s)
Returns how long String s is in bytes, if encoded in UTF-8

Parameters:
s - The string to be measured.
Returns:
The number of bytes s is when encoded in UTF-8

normaliseEncoding

public static java.lang.String normaliseEncoding(java.lang.String encodingName)
Normalises several common encodings found, for instance in HTTP or HTML headers, into the compatible Java encoding


Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow