forked from Coded/SIPRP
git-svn-id: https://svn.coded.pt/svn/SIPRP@1178 bb69d46d-e84e-40c8-a05a-06db0d633741
parent
482f0dddfe
commit
21e66ed1ac
@ -0,0 +1,63 @@
|
||||
package siprp.planoactuacao.print;
|
||||
|
||||
public class StringConverterUtils
|
||||
{
|
||||
public static String stripHTMLTags( String text )
|
||||
{
|
||||
String output = text;
|
||||
|
||||
output = output.replaceAll( "<br>", "" );
|
||||
output = output.replaceAll( "<p>", "" );
|
||||
output = output.replaceAll( "</p>", "" );
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
public static String convertHTMLToText( String text )
|
||||
{
|
||||
String output = text;
|
||||
|
||||
output = output.replaceAll( "À", "À" );
|
||||
output = output.replaceAll( "Á", "Á" );
|
||||
output = output.replaceAll( "Â", "Â" );
|
||||
output = output.replaceAll( "Ã", "Ã" );
|
||||
output = output.replaceAll( "Ç", "Ç" );
|
||||
output = output.replaceAll( "È", "È" );
|
||||
output = output.replaceAll( "É", "É" );
|
||||
output = output.replaceAll( "Ó", "Ó" );
|
||||
output = output.replaceAll( "Ò", "Ò" );
|
||||
|
||||
output = output.replaceAll( "Ê", "Ê" );
|
||||
output = output.replaceAll( "Ì", "Ì" );
|
||||
output = output.replaceAll( "Í", "Í" );
|
||||
output = output.replaceAll( "Î", "Î" );
|
||||
output = output.replaceAll( "Ô", "Ô" );
|
||||
output = output.replaceAll( "Õ", "Õ" );
|
||||
output = output.replaceAll( "Ù", "Ù" );
|
||||
output = output.replaceAll( "Ú", "Ú" );
|
||||
output = output.replaceAll( "Û", "Û" );
|
||||
|
||||
output = output.replaceAll( "à", "à" );
|
||||
output = output.replaceAll( "á", "á" );
|
||||
output = output.replaceAll( "â", "â" );
|
||||
output = output.replaceAll( "ã", "ã" );
|
||||
output = output.replaceAll( "ç", "ç" );
|
||||
output = output.replaceAll( "è", "è" );
|
||||
output = output.replaceAll( "é", "é" );
|
||||
output = output.replaceAll( "ê", "ê" );
|
||||
output = output.replaceAll( "ì", "ì" );
|
||||
output = output.replaceAll( "í", "í" );
|
||||
output = output.replaceAll( "î", "î" );
|
||||
output = output.replaceAll( "ò", "ò" );
|
||||
output = output.replaceAll( "ó", "ó" );
|
||||
output = output.replaceAll( "ô", "ô" );
|
||||
output = output.replaceAll( "õ", "õ" );
|
||||
output = output.replaceAll( "ù", "ù" );
|
||||
output = output.replaceAll( "ú", "ú" );
|
||||
output = output.replaceAll( "û", "û" );
|
||||
|
||||
output = output.replaceAll( " ", " " );
|
||||
return output;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue