# HG changeset patch # User Jacob Carlborg # Date 1303055831 -7200 # Node ID ff7053751d15be3640184f0cbec14d52864600d2 # Parent c81e3dc6b9adcdf553eede7d1cc58a9c231e9fee Added Phobos implementation of java.lang.String.indexOf and lastIndexOf. diff -r c81e3dc6b9ad -r ff7053751d15 base/src/java/lang/String.d --- a/base/src/java/lang/String.d Sun Apr 17 17:47:05 2011 +0200 +++ b/base/src/java/lang/String.d Sun Apr 17 17:57:11 2011 +0200 @@ -545,8 +545,7 @@ if( res is str.length ) res = -1; return res; } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return 0; + return std.string.indexOf(str[start .. $], ch); } } @@ -562,8 +561,7 @@ if( res is str.length ) res = -1; return res; } else { // Phobos - implMissing( __FILE__, __LINE__ ); - return 0; + return std.string.lastIndexOf(str[0 .. fromIndex], ch); } }