// String convd to const char *
}
-String::operator const char *() const
+ const char*
+String::ptr() const
{
return data;
}
return strcmp( data, s->data ) > 0;
}
#endif
+
// signed comparison, analogous to strcmp;
int
String::compare( const char* test ) const
strrev(s);
return retval;
}
+bool
+String::to_bool() const
+{
+ if (!len())
+ return false;
+ if (*this == "0")
+ return false;
+ String u (*this);
+ u.upper();
+ if (u== "FALSE")
+ return false;
+ return true;
+}