org.erights.e.develop.format
Class StringHelper

java.lang.Object
  |
  +--org.erights.e.develop.format.StringHelper

public final class StringHelper
extends Object

Untamed: Like the old StringSugar, except it's only a convenience for ELib programmers, not for E language programmers. E language programmers never see Java Strings directly, they only see Twine. Twine has some similar methods built on these.

Author:
Mark S. Miller

Constructor Summary
private StringHelper()
          prevent instantiation
 
Method Summary
static String aan(String self)
          Enabled: Return self prefixed by "a " or "an " according to a simple (and therefore inadequate) heuristic, but good enough for cheezy uses.
static String canonical(String self)
          Enabled: Each crlf is turned into an lf to deal with MSWindows, and then each remaining cr is turned into an lf to deal with Mac.
static String multiply(String self, int reps)
          Enabled: reps repitions of self
static String quote(String self)
          Enabled: Returns a string that, when interpreted as a literal, represents the original string.
static String replaceAll(String self, String oldStr, String newStr)
          Enabled: The string-based replaceAll() supplements the character-based replace().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringHelper

private StringHelper()
prevent instantiation

Method Detail

multiply

public static String multiply(String self,
                              int reps)
Enabled: reps repitions of self


replaceAll

public static String replaceAll(String self,
                                String oldStr,
                                String newStr)
Enabled: The string-based replaceAll() supplements the character-based replace().

See Also:
String.replace(char, char)

canonical

public static String canonical(String self)
Enabled: Each crlf is turned into an lf to deal with MSWindows, and then each remaining cr is turned into an lf to deal with Mac.


quote

public static String quote(String self)
Enabled: Returns a string that, when interpreted as a literal, represents the original string.


aan

public static String aan(String self)
Enabled: Return self prefixed by "a " or "an " according to a simple (and therefore inadequate) heuristic, but good enough for cheezy uses.

Note that this routine is not expected to internationalize well.



comments?