|
@@ -48,7 +48,7 @@ class StringTools {
|
|
|
return __call__("rawurlencode", s);
|
|
|
#elseif cpp
|
|
|
return s.__URLEncode();
|
|
|
- #elseif jvm
|
|
|
+ #elseif java
|
|
|
return untyped __java__("java.net.URLEncoder.encode(s)");
|
|
|
#else
|
|
|
return null;
|
|
@@ -71,7 +71,7 @@ class StringTools {
|
|
|
return __call__("urldecode", s);
|
|
|
#elseif cpp
|
|
|
return s.__URLDecode();
|
|
|
- #elseif jvm
|
|
|
+ #elseif java
|
|
|
return untyped __java__("java.net.URLDecoder.decode(s)");
|
|
|
#else
|
|
|
return null;
|
|
@@ -99,8 +99,8 @@ class StringTools {
|
|
|
/**
|
|
|
Tells if the string [s] starts with the string [start].
|
|
|
**/
|
|
|
- public static #if jvm inline #end function startsWith( s : String, start : String ) {
|
|
|
- #if jvm
|
|
|
+ public static #if java inline #end function startsWith( s : String, start : String ) {
|
|
|
+ #if java
|
|
|
return untyped s.startsWith(start);
|
|
|
#else
|
|
|
return( s.length >= start.length && s.substr(0, start.length) == start );
|
|
@@ -110,8 +110,8 @@ class StringTools {
|
|
|
/**
|
|
|
Tells if the string [s] ends with the string [end].
|
|
|
**/
|
|
|
- public static #if jvm inline #end function endsWith( s : String, end : String ) {
|
|
|
- #if jvm
|
|
|
+ public static #if java inline #end function endsWith( s : String, end : String ) {
|
|
|
+ #if java
|
|
|
return untyped s.endsWith(end);
|
|
|
#else
|
|
|
var elen = end.length;
|
|
@@ -228,10 +228,10 @@ class StringTools {
|
|
|
/**
|
|
|
Replace all occurences of the string [sub] in the string [s] by the string [by].
|
|
|
**/
|
|
|
- public #if (php || jvm) inline #end static function replace( s : String, sub : String, by : String ) : String {
|
|
|
+ public #if (php || java) inline #end static function replace( s : String, sub : String, by : String ) : String {
|
|
|
#if php
|
|
|
return untyped __call__("str_replace", sub, by, s);
|
|
|
- #elseif jvm
|
|
|
+ #elseif java
|
|
|
return untyped s.replace(sub, by);
|
|
|
#else
|
|
|
return s.split(sub).join(by);
|