Mercurial Hosting > luan
comparison core/src/luan/modules/StringLuan.java @ 548:f4dfe9c64c25
shorten some String function names
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 15 Jun 2015 17:30:28 -0600 |
parents | 473e456444ff |
children | e25ba7a2e816 |
comparison
equal
deleted
inserted
replaced
547:0be287ab0309 | 548:f4dfe9c64c25 |
---|---|
50 a[i] = (char)chars[i]; | 50 a[i] = (char)chars[i]; |
51 } | 51 } |
52 return new String(a); | 52 return new String(a); |
53 } | 53 } |
54 | 54 |
55 @LuanMethod public static byte[] string_to_binary(String s) { | 55 @LuanMethod public static byte[] to_binary(String s) { |
56 return s.getBytes(); | 56 return s.getBytes(); |
57 } | 57 } |
58 | 58 |
59 public static int len(LuanState luan,String s) throws LuanException { | 59 public static int len(LuanState luan,String s) throws LuanException { |
60 Utils.checkNotNull(luan,s); | 60 Utils.checkNotNull(luan,s); |
221 | 221 |
222 public static String encode(String s) { | 222 public static String encode(String s) { |
223 return Luan.stringEncode(s); | 223 return Luan.stringEncode(s); |
224 } | 224 } |
225 | 225 |
226 public static Number string_to_number(LuanState luan,String s,Integer base) throws LuanException { | 226 public static Number to_number(LuanState luan,String s,Integer base) throws LuanException { |
227 Utils.checkNotNull(luan,s); | 227 Utils.checkNotNull(luan,s); |
228 try { | 228 try { |
229 if( base == null ) { | 229 if( base == null ) { |
230 return Double.valueOf(s); | 230 return Double.valueOf(s); |
231 } else { | 231 } else { |