diff dwt/dwthelper/utils.d @ 200:08789b28bdf3

import dwt.dwthelper.utils now explicit
author Frank Benoit <benoit@tionex.de>
date Fri, 07 Mar 2008 03:12:23 +0100
parents 5db57b8ff1a9
children 12feeed18183
line wrap: on
line diff
--- a/dwt/dwthelper/utils.d	Fri Mar 07 01:40:43 2008 +0100
+++ b/dwt/dwthelper/utils.d	Fri Mar 07 03:12:23 2008 +0100
@@ -6,6 +6,8 @@
 public import dwt.dwthelper.System;
 public import Math = tango.math.Math;
 
+public import tango.core.Exception : IllegalArgumentException, IOException;
+
 import tango.io.Stdout;
 import tango.stdc.stringz;
 static import tango.text.Util;
@@ -257,6 +259,10 @@
     return res;
 }
 
+public char[] replace( char[] str, char from, char to ){
+    return tango.text.Util.replace( str.dup, from, to );
+}
+
 public char[] substring( char[] str, int start ){
     return str[ start .. $ ].dup;
 }
@@ -300,6 +306,12 @@
     return tango.text.Unicode.toFold(src) == tango.text.Unicode.toFold(other);
 }
 
+public bool startsWith( char[] src, char[] pattern ){
+    if( src.length < pattern.length ){
+        return false;
+    }
+    return src[ 0 .. pattern.length ] == pattern;
+}
 public char[] toLowerCase( char[] src ){
     return tango.text.Unicode.toLower( src );
 }