Mercurial Hosting > luan
comparison src/luan/modules/HtmlLuan.java @ 1469:21f5edab1fbf
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 14 Apr 2020 13:15:18 -0600 |
parents | a015a0b5c388 |
children | 36c28be6d432 |
comparison
equal
deleted
inserted
replaced
1468:35f3bfd4f51d | 1469:21f5edab1fbf |
---|---|
15 | 15 |
16 public final class HtmlLuan { | 16 public final class HtmlLuan { |
17 | 17 |
18 public static String encode(String s) throws LuanException { | 18 public static String encode(String s) throws LuanException { |
19 Utils.checkNotNull(s); | 19 Utils.checkNotNull(s); |
20 char[] a = s.toCharArray(); | 20 final char[] a = s.toCharArray(); |
21 StringBuilder buf = new StringBuilder(); | 21 StringBuilder buf = new StringBuilder(); |
22 for( int i=0; i<a.length; i++ ) { | 22 for( char c : a ) { |
23 char c = a[i]; | |
24 switch(c) { | 23 switch(c) { |
25 case '&': | 24 case '&': |
26 buf.append("&"); | 25 buf.append("&"); |
27 break; | 26 break; |
28 case '<': | 27 case '<': |