/**
* Statische Hilfsmethoden zur Stringbehandlung
*
- * @version $Revision: 1.23.2.1 $ $Date: 2002/09/01 21:31:40 $
- * @author $Author: mh $
- *
- * $Log: StringUtil.java,v $
- * Revision 1.23.2.1 2002/09/01 21:31:40 mh
- * Mir goes GPL
- *
- * Revision 1.23 2002/06/28 20:39:37 mh
- * added numberformat helper. make webdbDate2readableDate use webdb_create instead. make the order and appearance of it more consistent. cvs macros. and finally code tidying
- *
+ * @version $Id: StringUtil.java,v 1.23.2.2 2002/11/28 05:52:40 mh Exp $
+ * @author rk, mir-coders group
*
*/
+
public final class StringUtil {
private static RE re_newline2br, re_brbr2p, re_mail, re_url, re_tags;
return buf.toString();
}
-
- public static String decodeHTMLinTags(String s){
- StringBuffer buffer = new StringBuffer();
- boolean start = false;
- boolean stop = false;
- int startIndex = 0;
- int stopIndex = 0;
- int temp = 0;
-
- for(int i=0;i<s.length();i++){
- if(s.charAt(i)=='<'){
- start = true;
- startIndex = i;
- } else if(s.charAt(i)=='>'){
- stop = true;
- stopIndex = i;
-
- if(start && stop){
- buffer.append(s.substring(temp,startIndex));
- buffer.append(replaceQuot(s.substring(startIndex,stopIndex+1)));
- i= temp= stopIndex+1;
- start= stop= false;
- }
- }
- }
- if(stopIndex>0){
- buffer.append(s.substring(stopIndex+1));
- return buffer.toString();
- } else {
- return s;
- }
- }
-
public static String replaceQuot(String s) {
StringBuffer buffer = new StringBuffer();
for(int j = 0; j < s.length();j++){
return buffer.toString();
}
- /** wandelt Quotes in Sonderzeichen um
- */
- /**
- public static String decodeHtml(String s) {
- StringBuffer buf = new StringBuffer();
- for(int i=0;i < s.length(); i++ ) {
- if( s.indexOf( "ö", i ) == i ) {
- buf.append( "ö" ); i += 5;
- continue;
- }
- if( s.indexOf( "ä", i ) == i ) {
- buf.append( "ä" ); i += 5;
- continue;
- }
- if( s.indexOf( "ü", i ) == i ) {
- buf.append( "ü" ); i += 5;
- continue;
- }
- if( s.indexOf( "Ö", i ) == i ) {
- buf.append( "Ö" ); i += 5;
- continue;
- }
- if( s.indexOf( "Ä", i ) == i ) {
- buf.append( "Ä" ); i += 5;
- continue;
- }
- if( s.indexOf( "Ü", i ) == i ) {
- buf.append( "Ü" ); i += 5;
- continue;
- }
- if( s.indexOf( "ß", i ) == i ) {
- buf.append( "ß" ); i += 6;
- continue;
- }
- if( s.indexOf( """, i ) == i ) {
- buf.append( "\"" ); i += 5;
- continue;
- }
- buf.append( s.charAt(i) );
- }
- return buf.toString();
- }
- */
-
/**
* schnellere Variante der String.toLowerCase()-Routine
*