jonelo.sugar.util

Class GeneralString


public class GeneralString
extends java.lang.Object

Sugar for Java 1.3.0 Copyright (C) 2001-2005 Dipl.-Inf. (FH) Johann Nepomuk Loefflmann, All Rights Reserved, http://www.jonelo.de This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Constructor Summary

GeneralString()
Creates new GeneralString

Method Summary

static int
countChar(String s, char c)
static String
decodeEncodedUnicode(String string)
Converts encoded \uxxxx to unicode chars
static String
encodeUnicode(String string)
static String
message(String s, String s1)
static String
message(String s, char c)
static String
message(String s, int i)
static String
message(String s, int i1, int i2)
static char
nibbleToHexChar(int nibble)
static String
removeAllStrings(String source, String oldString)
static String
removeChar(String s, char c)
static String
removeChar(String s, int pos)
static String
replaceAllStrings(String source, String oldString, String newString)
Replaces all oldStrings found within source by newString
static void
replaceAllStrings(StringBuffer source, String oldString, String newString)
Replaces all oldStrings found within source by newString
static String
replaceChar(String s, char oldC, char newC)
replaces all characters oldC in a String s with character newC
static String
replaceChar(String s, int pos, char c)
static String
replaceString(String source, String oldString, String newString)
Replaces none or only one String oldString to newString in String source
static String
replaceString(String s, int pos, String newString)
Overwrites a string s at a given position with newString
static String[]
split(String str, String delimiter)
static String
translateEscapeSequences(String s)

Constructor Details

GeneralString

public GeneralString()
Creates new GeneralString

Method Details

countChar

public static int countChar(String s,
                            char c)

decodeEncodedUnicode

public static String decodeEncodedUnicode(String string)
Converts encoded \uxxxx to unicode chars

encodeUnicode

public static String encodeUnicode(String string)

message

public static String message(String s,
                             String s1)

message

public static String message(String s,
                             char c)

message

public static String message(String s,
                             int i)

message

public static String message(String s,
                             int i1,
                             int i2)

nibbleToHexChar

public static char nibbleToHexChar(int nibble)

removeAllStrings

public static String removeAllStrings(String source,
                                      String oldString)

removeChar

public static String removeChar(String s,
                                char c)

removeChar

public static String removeChar(String s,
                                int pos)

replaceAllStrings

public static String replaceAllStrings(String source,
                                       String oldString,
                                       String newString)
Replaces all oldStrings found within source by newString

replaceAllStrings

public static void replaceAllStrings(StringBuffer source,
                                     String oldString,
                                     String newString)
Replaces all oldStrings found within source by newString

replaceChar

public static String replaceChar(String s,
                                 char oldC,
                                 char newC)
replaces all characters oldC in a String s with character newC

replaceChar

public static String replaceChar(String s,
                                 int pos,
                                 char c)

replaceString

public static String replaceString(String source,
                                   String oldString,
                                   String newString)
Replaces none or only one String oldString to newString in String source

replaceString

public static String replaceString(String s,
                                   int pos,
                                   String newString)
Overwrites a string s at a given position with newString

split

public static String[] split(String str,
                             String delimiter)

translateEscapeSequences

public static String translateEscapeSequences(String s)
Since:
1.0.1