Copyright 2012-02-25 Werner Randelshofer

ch.randelshofer.util
Class Strings

java.lang.Object
  extended by ch.randelshofer.util.Strings

public class Strings
extends java.lang.Object

This class contains various methods for manipulating strings.

Version:
1.2 2002-05-10 Method replace(String, String, String) added.
1.1 2002-02-05
Author:
Werner Randelshofer, Hausmatt 10, Immensee, CH-6405, Switzerland

Constructor Summary
Strings()
           
 
Method Summary
static java.lang.String camelToWords(java.lang.String str)
           
static java.lang.String replace(java.lang.String str, java.lang.String from, java.lang.String to)
          Replaces all occurences of 'from' by 'to'.
static java.lang.String translate(java.lang.String s, char[] from, char[] to)
          Translates all occurences of characters in the char array 'from' to the characters in 'to'.
static java.lang.String translate(java.lang.String str, char from, char to)
          Translates all occurences of char 'from' to char 'to'.
 
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

translate

public static java.lang.String translate(java.lang.String s,
                                         char[] from,
                                         char[] to)
Translates all occurences of characters in the char array 'from' to the characters in 'to'.

Parameters:
s - The string to be translated.
from - The characters to be replaced.
to - The replacement characters.
Returns:
The translated String.

translate

public static java.lang.String translate(java.lang.String str,
                                         char from,
                                         char to)
Translates all occurences of char 'from' to char 'to'.

Parameters:
str - The string to be translated.
from - The character to be replaced.
to - The replacement character.
Returns:
The translated String.

replace

public static java.lang.String replace(java.lang.String str,
                                       java.lang.String from,
                                       java.lang.String to)
Replaces all occurences of 'from' by 'to'.

Parameters:
str - The string to be processed.
from - The text to be replaced.
to - The replacement text.
Returns:
The translated String.

camelToWords

public static java.lang.String camelToWords(java.lang.String str)

Copyright 2012-02-25 Werner Randelshofer