Mercurial > projects > dwt-linux
diff dwt/dwthelper/utils.d @ 190:934fb859da8e
Added DateTime
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 03 Mar 2008 21:23:28 +0100 |
parents | 1fa3c8d88486 |
children | 5db57b8ff1a9 |
line wrap: on
line diff
--- a/dwt/dwthelper/utils.d Mon Mar 03 00:34:00 2008 +0100 +++ b/dwt/dwthelper/utils.d Mon Mar 03 21:23:28 2008 +0100 @@ -247,6 +247,15 @@ return res; } +public int lastIndexOf(char[] str, char ch){ + return lastIndexOf( str, ch, str.length ); +} +public int lastIndexOf(char[] str, char ch, int formIndex){ + int res = tango.text.Util.locatePrior( str, ch, formIndex ); + if( res is str.length ) res = -1; + return res; +} + public char[] substring( char[] str, int start ){ return str[ start .. $ ].dup; } @@ -286,6 +295,10 @@ return src == other; } +public bool equalsIgnoreCase( char[] src, char[] other ){ + return tango.text.Unicode.toFold(src) == tango.text.Unicode.toFold(other); +} + public char[] toLowerCase( char[] src ){ return tango.text.Unicode.toLower( src ); }