Index: XmlTools2/trunk/optionsparser.cpp
===================================================================
--- XmlTools2/trunk/optionsparser.cpp	(revision 941)
+++ XmlTools2/trunk/optionsparser.cpp	(revision 942)
@@ -97,5 +97,5 @@
 
                 if(line.startsWith('"')){ // Only read when starting with quotes
-                    temp=Util::substring(line," \""); // We need to use more than space, because if paths contains spaces...
+                    temp=line.split(" \""); // We need to use more than space, because if paths contains spaces...
                     patchFiles << temp[0].remove('"'); // remove the quotes, they are now not needed
                     targetXmlFiles << temp[1].remove('"');
Index: XmlTools2/trunk/util.cpp
===================================================================
--- XmlTools2/trunk/util.cpp	(revision 941)
+++ XmlTools2/trunk/util.cpp	(revision 942)
@@ -107,20 +107,21 @@
 }
 
-QStringList substring(const QString &myString,const QString &separator, Qt::CaseSensitivity cs){
-    QStringList result = QStringList();
-    int currIdx=0, nextIdx=0;
-
-    while(true){
-        nextIdx=myString.indexOf(separator,currIdx,cs);
-        result << myString.mid(currIdx,nextIdx-currIdx);
-        if(nextIdx==-1) break;
-        currIdx=nextIdx+1;
-    }
-
-    return result;
-}
+// Use qstring split
+//QStringList substring(const QString &myString,const QString &separator, Qt::CaseSensitivity cs){
+//    QStringList result = QStringList();
+//    int currIdx=0, nextIdx=0;
+
+//    while(true){
+//        nextIdx=myString.indexOf(separator,currIdx,cs);
+//        result << myString.mid(currIdx,nextIdx-currIdx);
+//        if(nextIdx==-1) break;
+//        currIdx=nextIdx+1;
+//    }
+
+//    return result;
+//}
 
 QStringList qStringListFromSpacedString(const QString &mySpacedString){
-    return Util::substring(mySpacedString," ");
+    return mySpacedString.split(" ");
 }
 
@@ -129,5 +130,5 @@
     QList<int> intList;
 
-    stringList = Util::substring(mySpacedString," ");
+    stringList = mySpacedString.split(" ");
 
     foreach(QString value, stringList){
@@ -142,5 +143,5 @@
     QList<double> doubleList;
 
-    stringList = Util::substring(mySpacedString," ");
+    stringList = mySpacedString.split(" ");
 
     foreach(QString value, stringList){
Index: XmlTools2/trunk/util.h
===================================================================
--- XmlTools2/trunk/util.h	(revision 941)
+++ XmlTools2/trunk/util.h	(revision 942)
@@ -6,5 +6,4 @@
 #include <QString>
 #include <QStringList>
-#include <QRegExp>
 #include <iostream> // cout, cin etc.
 
@@ -25,5 +24,6 @@
 QString fullTrim(QString str);
 QString normalizeDecimalSeparator(QString value);
-QStringList substring(const QString &myString, const QString &separator, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+// Use qstring split
+// QStringList substring(const QString &myString, const QString &separator, Qt::CaseSensitivity cs = Qt::CaseSensitive);
 QStringList qStringListFromSpacedString(const QString &mySpacedString);
 QStringList getAllFilesByWildcard(const QString &wildcard);
@@ -51,10 +51,33 @@
 }
 
+// Needs optimization
 inline QStringList QStringToArgsArray(const QString &args){
     QStringList result;
-    result=Util::substring(args," ");
+    int startIdx=0, endIdx=0;
 
-    for(int i=0; i<result.size(); i++){
-        result[i].remove('"'); // remove quotes, they are not necessary as we had already splited the spaces
+    if(!args.isEmpty()){ // if non empty arguments
+
+        while(endIdx<args.length()){
+
+            startIdx=endIdx;
+
+            if(args.at(startIdx)==' '){ // Ignore spaces until a different char is found
+                endIdx++;
+                continue;
+            }
+            else if(args.at(startIdx)!='"'){ // if first character is different from quote it ends with space
+                endIdx=args.indexOf(' ',startIdx+1);
+            }
+            else{ // If is a quote try to get the all the string until next quote
+                endIdx=args.indexOf('"',startIdx+1);
+            }
+
+            if(endIdx==-1) break;
+
+            endIdx++;
+
+            result << args.mid(startIdx,endIdx-startIdx).replace("\"","").trimmed(); // remove quotes
+        }
+
     }
 
