001 package com.croftsoft.core.net; 002 003 import com.croftsoft.core.lang.*; 004 005 /********************************************************************* 006 * <P> 007 * A collection of constants and static methods to supplement 008 * the java.net package. 009 * <P> 010 * @version 011 * 1997-04-18 012 * @author 013 * <A HREF="http://www.alumni.caltech.edu/~croft">David W. Croft</A> 014 *********************************************************************/ 015 016 public final class Net { 017 ////////////////////////////////////////////////////////////////////// 018 ////////////////////////////////////////////////////////////////////// 019 020 /********************************************************************* 021 * Removes everything between bracket pairs plus the brackets. 022 *********************************************************************/ 023 public static final String strip_HTML_tags ( String s ) { 024 ////////////////////////////////////////////////////////////////////// 025 String stripped = new String ( s ); 026 int index = -1; 027 int end_index; 028 while ( ( index = stripped.indexOf ( '<' ) ) >= 0 ) { 029 if ( ( end_index = stripped.indexOf ( '>', index ) ) >= 0 ) { 030 stripped = StringLib.remove ( stripped, index, end_index ); 031 } else break; 032 } 033 return stripped; 034 } 035 036 ////////////////////////////////////////////////////////////////////// 037 ////////////////////////////////////////////////////////////////////// 038 }