diff --git a/src/core/CLTool.cpp b/src/core/CLTool.cpp
index 8f6b814e206abe4e9829521ef15e9733edee17b0..527e5b6cbed7ebe7cd4e6f4fc4ec2c60ecbae4b7 100644
--- a/src/core/CLTool.cpp
+++ b/src/core/CLTool.cpp
@@ -94,7 +94,7 @@ bool CLTool::readCommandLineArgs( int argc, char**argv, FILE*out ){
                if( a==thiskey ){
                    prefix=thiskey+"="; found=true;
                    inputData.insert(std::pair<std::string,std::string>(thiskey,""));
-               } else if( a.find(thiskey+"=")==0){
+               } else if(Tools::startWith(a,thiskey+"=")){
                    a.erase(0,a.find("=")+1); prefix=""; found=true;
                    if(inputData.count(thiskey)==0){
                       inputData.insert(std::pair<std::string,std::string>(thiskey,a));
diff --git a/src/core/CLToolMain.cpp b/src/core/CLToolMain.cpp
index e5eb16190b36e104c2b4de80f6d4c14cd3c0bd28..10fa902b6c3fc00ba74a8bf4e0197d44abde0a73 100644
--- a/src/core/CLToolMain.cpp
+++ b/src/core/CLToolMain.cpp
@@ -144,7 +144,7 @@ int CLToolMain::run(int argc, char **argv,FILE*in,FILE*out,Communicator& pc){
       }
     } else if(a=="--standalone-executable"){
       standalone_executable=true;
-    } else if(a.find("--load=")==0){
+    } else if(Tools::startWith(a,"--load=")){
       a.erase(0,a.find("=")+1);
       prefix="";
       void *p=dlloader.load(a);
diff --git a/src/tools/Tools.cpp b/src/tools/Tools.cpp
index 3e7063813e8078703f068ea50555f23c31f6ee9e..c1ffe96f96886c38c78d0e2094ef261265afd0a4 100644
--- a/src/tools/Tools.cpp
+++ b/src/tools/Tools.cpp
@@ -322,4 +322,9 @@ std::string Tools::extension(const std::string&s){
   return ext;
 }
 
+bool Tools::startWith(const std::string & full,const std::string &start){
+  return (full.substr(0,start.length())==start);
+}
+
+
 }
diff --git a/src/tools/Tools.h b/src/tools/Tools.h
index 99592ce99d6102f18520fb0a912b0fba908b5af4..f4b00e9266b55623c5c8203b654e94989affb2bf 100644
--- a/src/tools/Tools.h
+++ b/src/tools/Tools.h
@@ -121,6 +121,9 @@ public:
   static std::string extension(const std::string&);
 /// Fast int power
   static double fastpow(double base,int exp);
+/// Check if a string full starts with string start.
+/// Same as full.find(start)==0
+  static bool startWith(const std::string & full,const std::string &start);
 };
 
 template <class T>