Organized imports.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / wizards / html / HTMLUtilities.java
1 /*
2  * $Id: HTMLUtilities.java,v 1.1 2004-10-05 20:51:57 jsurfer Exp $
3  * Copyright Narushima Hironori. All rights reserved.
4  */
5 package net.sourceforge.phpeclipse.wizards.html;
6
7
8 /**
9  * 
10  */
11 public class HTMLUtilities {
12
13         final static String[] specialMarks = {
14                 "&", "&",
15                 "<", "&lt;",
16                 ">", "&gt;",
17                 "\"", "&quot;",
18         };
19
20         public static String escape(String text){
21                 for (int i = 0; i < specialMarks.length; i+=2) {
22                         text = text.replaceAll(specialMarks[i], specialMarks[i+1]);
23                 }
24                 return text;
25         }
26         
27         public static String unescape(String text){
28                 for (int i = specialMarks.length-1; i>=0 ; i-=2) {
29                         text = text.replaceAll(specialMarks[i], specialMarks[i-1]);
30                 }
31                 return text;
32         }
33         
34         
35         
36         
37 }