codesimian
Class Strings

java.lang.Object
  extended by codesimian.Strings

public class Strings
extends java.lang.Object


Nested Class Summary
static class Strings.PrintCS
          Prints the toString() of param0.
static class Strings.PrintNumber
          Prints the value of param0.D() to standard output.
static class Strings.PrintString
          Prints a String to standard output, or if countP()==2 prints to P(1).
static class Strings.ReadChar
          Reads a char from standard input (usually keyboard).
static class Strings.StringSplit
          same as java.lang.String.split(String regularExpressionDelimiter), but copied here so applets (on the internet) can use it without complaining about security of dynamic method calls.
static class Strings.TokenizeAllCharPairs
           
 
Constructor Summary
Strings()
           
 
Method Summary
static java.lang.String escape(java.lang.String includesEscapeChars)
          In a String with escape characters (preceded by \) removes \ and the following char and replaces it with whatever standard string rules say.
static int[] quantityOfEachLetter(java.lang.String x)
          returns an array size 26, how many of each letter (case INsensitive) is in the String
static java.lang.String replace(java.lang.String theString, java.lang.String replaceMe, java.lang.String replaceWith)
           
static double similarity(java.lang.String a, java.lang.String b)
          returns some interpretation of similarity.
static NothingList stringToCharList(java.lang.String myChars)
          Returns a CS whose params are Const's with the char values from the string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Strings

public Strings()
Method Detail

stringToCharList

public static NothingList stringToCharList(java.lang.String myChars)
Returns a CS whose params are Const's with the char values from the string. Returns Consts from Const's static constant-pool.


similarity

public static double similarity(java.lang.String a,
                                java.lang.String b)
returns some interpretation of similarity. Currently it just compares quantities of each letter.


quantityOfEachLetter

public static int[] quantityOfEachLetter(java.lang.String x)
returns an array size 26, how many of each letter (case INsensitive) is in the String


escape

public static java.lang.String escape(java.lang.String includesEscapeChars)
In a String with escape characters (preceded by \) removes \ and the following char and replaces it with whatever standard string rules say.

For example, \t becomes a TAB and \n is a NEWLINE and \\ is a BACKSLASH.

This function is not finished. It needs to include all valid Java String escape-codes. What are those?


replace

public static java.lang.String replace(java.lang.String theString,
                                       java.lang.String replaceMe,
                                       java.lang.String replaceWith)