Index: libcfa/src/collections/string.cfa
===================================================================
--- libcfa/src/collections/string.cfa	(revision 737988bf3f2f8b1083edbdc9226c3c7547b170d6)
+++ libcfa/src/collections/string.cfa	(revision 334e0cf23899bfd4df7f5e70210364de3265d541)
@@ -157,19 +157,28 @@
 // Comparison
 
-bool ?==?(const string & s, const string & other) {
-    return *s.inner == *other.inner;
-}
-
-bool ?!=?(const string & s, const string & other) {
-    return *s.inner != *other.inner;
-}
-
-bool ?==?(const string & s, const char * other) {
-    return *s.inner == other;
-}
-
-bool ?!=?(const string & s, const char * other) {
-    return *s.inner != other;
-}
+int  cmp (const string &s1, const string &s2) { return cmp(*s1.inner ,  *s2.inner); }
+bool ?==?(const string &s1, const string &s2) { return     *s1.inner == *s2.inner ; }
+bool ?!=?(const string &s1, const string &s2) { return     *s1.inner != *s2.inner ; }
+bool ?>? (const string &s1, const string &s2) { return     *s1.inner >  *s2.inner ; }
+bool ?>=?(const string &s1, const string &s2) { return     *s1.inner >= *s2.inner ; }
+bool ?<=?(const string &s1, const string &s2) { return     *s1.inner <= *s2.inner ; }
+bool ?<? (const string &s1, const string &s2) { return     *s1.inner <  *s2.inner ; }
+
+int  cmp (const string &s1, const char*   s2) { return cmp(*s1.inner ,   s2      ); }
+bool ?==?(const string &s1, const char*   s2) { return     *s1.inner ==  s2       ; }
+bool ?!=?(const string &s1, const char*   s2) { return     *s1.inner !=  s2       ; }
+bool ?>? (const string &s1, const char*   s2) { return     *s1.inner >   s2       ; }
+bool ?>=?(const string &s1, const char*   s2) { return     *s1.inner >=  s2       ; }
+bool ?<=?(const string &s1, const char*   s2) { return     *s1.inner <=  s2       ; }
+bool ?<? (const string &s1, const char*   s2) { return     *s1.inner <   s2       ; }
+
+int  cmp (const char*   s1, const string &s2) { return cmp( s1       ,  *s2.inner); }
+bool ?==?(const char*   s1, const string &s2) { return      s1       == *s2.inner ; }
+bool ?!=?(const char*   s1, const string &s2) { return      s1       != *s2.inner ; }
+bool ?>? (const char*   s1, const string &s2) { return      s1       >  *s2.inner ; }
+bool ?>=?(const char*   s1, const string &s2) { return      s1       >= *s2.inner ; }
+bool ?<=?(const char*   s1, const string &s2) { return      s1       <= *s2.inner ; }
+bool ?<? (const char*   s1, const string &s2) { return      s1       <  *s2.inner ; }
+
 
 ////////////////////////////////////////////////////////
Index: libcfa/src/collections/string.hfa
===================================================================
--- libcfa/src/collections/string.hfa	(revision 737988bf3f2f8b1083edbdc9226c3c7547b170d6)
+++ libcfa/src/collections/string.hfa	(revision 334e0cf23899bfd4df7f5e70210364de3265d541)
@@ -116,8 +116,28 @@
 
 // Comparisons
-bool ?==?(const string & s, const string & other);
-bool ?!=?(const string & s, const string & other);
-bool ?==?(const string & s, const char * other);
-bool ?!=?(const string & s, const char * other);
+int  cmp (const string &, const string &);
+bool ?==?(const string &, const string &);
+bool ?!=?(const string &, const string &);
+bool ?>? (const string &, const string &);
+bool ?>=?(const string &, const string &);
+bool ?<=?(const string &, const string &);
+bool ?<? (const string &, const string &);
+
+int  cmp (const string &, const char*);
+bool ?==?(const string &, const char*);
+bool ?!=?(const string &, const char*);
+bool ?>? (const string &, const char*);
+bool ?>=?(const string &, const char*);
+bool ?<=?(const string &, const char*);
+bool ?<? (const string &, const char*);
+
+int  cmp (const char*, const string &);
+bool ?==?(const char*, const string &);
+bool ?!=?(const char*, const string &);
+bool ?>? (const char*, const string &);
+bool ?>=?(const char*, const string &);
+bool ?<=?(const char*, const string &);
+bool ?<? (const char*, const string &);
+
 
 // Slicing
Index: libcfa/src/collections/string_res.cfa
===================================================================
--- libcfa/src/collections/string_res.cfa	(revision 737988bf3f2f8b1083edbdc9226c3c7547b170d6)
+++ libcfa/src/collections/string_res.cfa	(revision 334e0cf23899bfd4df7f5e70210364de3265d541)
@@ -637,19 +637,42 @@
 // Comparisons
 
-
-bool ?==?(const string_res &s1, const string_res &s2) {
-    return ByteCmp( s1.Handle.s, 0, s1.Handle.lnth, s2.Handle.s, 0, s2.Handle.lnth) == 0;
-}
-
-bool ?!=?(const string_res &s1, const string_res &s2) {
-    return !(s1 == s2);
-}
-bool ?==?(const string_res &s, const char* other) {
-    string_res sother = other;
-    return s == sother;
-}
-bool ?!=?(const string_res &s, const char* other) {
-    return !(s == other);
-}
+int cmp(const string_res &s1, const string_res &s2) {
+    // return 0;
+    int ans1 = memcmp(s1.Handle.s, s2.Handle.s, min(s1.Handle.lnth, s2.Handle.lnth));
+    if (ans1 != 0) return ans1;
+    return s1.Handle.lnth - s2.Handle.lnth;
+}
+
+bool ?==?(const string_res &s1, const string_res &s2) { return cmp(s1, s2) == 0; }
+bool ?!=?(const string_res &s1, const string_res &s2) { return cmp(s1, s2) != 0; }
+bool ?>? (const string_res &s1, const string_res &s2) { return cmp(s1, s2) >  0; }
+bool ?>=?(const string_res &s1, const string_res &s2) { return cmp(s1, s2) >= 0; }
+bool ?<=?(const string_res &s1, const string_res &s2) { return cmp(s1, s2) <= 0; }
+bool ?<? (const string_res &s1, const string_res &s2) { return cmp(s1, s2) <  0; }
+
+int cmp (const string_res &s1, const char* s2) {
+    string_res s2x = s2;
+    return cmp(s1, s2x);
+}
+
+bool ?==?(const string_res &s1, const char* s2) { return cmp(s1, s2) == 0; }
+bool ?!=?(const string_res &s1, const char* s2) { return cmp(s1, s2) != 0; }
+bool ?>? (const string_res &s1, const char* s2) { return cmp(s1, s2) >  0; }
+bool ?>=?(const string_res &s1, const char* s2) { return cmp(s1, s2) >= 0; }
+bool ?<=?(const string_res &s1, const char* s2) { return cmp(s1, s2) <= 0; }
+bool ?<? (const string_res &s1, const char* s2) { return cmp(s1, s2) <  0; }
+
+int cmp (const char* s1, const string_res & s2) {
+    string_res s1x = s1;
+    return cmp(s1x, s2);
+}
+
+bool ?==?(const char* s1, const string_res &s2) { return cmp(s1, s2) == 0; }
+bool ?!=?(const char* s1, const string_res &s2) { return cmp(s1, s2) != 0; }
+bool ?>? (const char* s1, const string_res &s2) { return cmp(s1, s2) >  0; }
+bool ?>=?(const char* s1, const string_res &s2) { return cmp(s1, s2) >= 0; }
+bool ?<=?(const char* s1, const string_res &s2) { return cmp(s1, s2) <= 0; }
+bool ?<? (const char* s1, const string_res &s2) { return cmp(s1, s2) <  0; }
+
 
 
Index: libcfa/src/collections/string_res.hfa
===================================================================
--- libcfa/src/collections/string_res.hfa	(revision 737988bf3f2f8b1083edbdc9226c3c7547b170d6)
+++ libcfa/src/collections/string_res.hfa	(revision 334e0cf23899bfd4df7f5e70210364de3265d541)
@@ -142,8 +142,27 @@
 
 // Comparisons
-bool ?==?(const string_res &s, const string_res &other);
-bool ?!=?(const string_res &s, const string_res &other);
-bool ?==?(const string_res &s, const char* other);
-bool ?!=?(const string_res &s, const char* other);
+int  cmp (const string_res &, const string_res &);
+bool ?==?(const string_res &, const string_res &);
+bool ?!=?(const string_res &, const string_res &);
+bool ?>? (const string_res &, const string_res &);
+bool ?>=?(const string_res &, const string_res &);
+bool ?<=?(const string_res &, const string_res &);
+bool ?<? (const string_res &, const string_res &);
+
+int  cmp (const string_res &, const char*);
+bool ?==?(const string_res &, const char*);
+bool ?!=?(const string_res &, const char*);
+bool ?>? (const string_res &, const char*);
+bool ?>=?(const string_res &, const char*);
+bool ?<=?(const string_res &, const char*);
+bool ?<? (const string_res &, const char*);
+
+int  cmp (const char*, const string_res &);
+bool ?==?(const char*, const string_res &);
+bool ?!=?(const char*, const string_res &);
+bool ?>? (const char*, const string_res &);
+bool ?>=?(const char*, const string_res &);
+bool ?<=?(const char*, const string_res &);
+bool ?<? (const char*, const string_res &);
 
 // String search
