|
@@ -2,20 +2,18 @@
|
|
|
using namespace hv;
|
|
using namespace hv;
|
|
|
|
|
|
|
|
int main(int argc, char** argv) {
|
|
int main(int argc, char** argv) {
|
|
|
- /*
|
|
|
|
|
- char str1[] = "a1B2*C3d4==";
|
|
|
|
|
- char str2[] = "a1B2*C3d4==";
|
|
|
|
|
- printf("strupper %s\n", strupper(str1));
|
|
|
|
|
- printf("strlower %s\n", strlower(str2));
|
|
|
|
|
- char str3[] = "abcdefg";
|
|
|
|
|
- printf("strreverse %s\n", strreverse(str3));
|
|
|
|
|
-
|
|
|
|
|
- char str4[] = "123456789";
|
|
|
|
|
- printf("strstartswith=%d\nstrendswith=%d\nstrcontains=%d\n",
|
|
|
|
|
- (int)strstartswith(str4, "123"),
|
|
|
|
|
- (int)strendswith(str4, "789"),
|
|
|
|
|
- (int)strcontains(str4, "456"));
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ std::string str1 = "a1B2*C3d4==";
|
|
|
|
|
+ std::string str2 = "a1B2*C3d4==";
|
|
|
|
|
+ printf("toupper %s\n", toupper(str1).c_str());
|
|
|
|
|
+ printf("tolower %s\n", tolower(str2).c_str());
|
|
|
|
|
+ std::string str3 = "abcdefg";
|
|
|
|
|
+ printf("reverse %s\n", reverse(str3).c_str());
|
|
|
|
|
+
|
|
|
|
|
+ std::string str4 = "123456789";
|
|
|
|
|
+ printf("startswith=%d\nendswith=%d\ncontains=%d\n",
|
|
|
|
|
+ (int)startswith(str4, "123"),
|
|
|
|
|
+ (int)endswith(str4, "789"),
|
|
|
|
|
+ (int)contains(str4, "456"));
|
|
|
|
|
|
|
|
std::string str5 = asprintf("%s%d", "hello", 5);
|
|
std::string str5 = asprintf("%s%d", "hello", 5);
|
|
|
printf("asprintf %s\n", str5.c_str());
|
|
printf("asprintf %s\n", str5.c_str());
|