anecho.gui
Class TextUtils

java.lang.Object
  extended by anecho.gui.TextUtils

public class TextUtils
extends java.lang.Object

This class contains methods to do some common string requirements such as stripping escape characters.


Method Summary
static java.lang.String cleanURL(java.lang.String input)
          This method is used to remove extra characters from a URL.
static double stringToDouble(java.lang.String input)
          This method converts the numeric portion of a String to an Int.
static java.lang.String stripEscapes(java.lang.String token, boolean useBell)
          This method returns the value of a string once it has had any escape characters stripped from it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

stripEscapes

public static java.lang.String stripEscapes(java.lang.String token,
                                            boolean useBell)
This method returns the value of a string once it has had any escape characters stripped from it.

Parameters:
token - The string that will be analysed for escape characters.
useBell - true - trigger system "bell" if a bell sequence is stripped. false - do not trigger the system "bell" if a bell sequence is stripped.
Returns:
Returns the initial string with escapes removed.

cleanURL

public static java.lang.String cleanURL(java.lang.String input)
This method is used to remove extra characters from a URL. Thoug not entirely scientific, it will get rid of things like trailing quotation marks

Parameters:
input -
Returns:

stringToDouble

public static double stringToDouble(java.lang.String input)
This method converts the numeric portion of a String to an Int. For example, having a Java version of 1.6.0_01 will return 1.6.0 (discarding everything after the first non-numeric character)

Parameters:
input - A mix string of numbers and characters
Returns:
An integer based on the intial string