Create winapi_shell_trim.c

This commit is contained in:
Jan Bodnar 2016-04-07 15:42:51 +02:00
parent 630449cb64
commit b78d2a077e

View File

@ -0,0 +1,28 @@
#include <windows.h>
#include <wchar.h>
#include <stdbool.h>
#include "Shlwapi.h"
#pragma comment(lib, "Shlwapi.lib")
int wmain(void) {
wchar_t buf[] = L"23tennis74";
wchar_t trim[] = L"0123456789";
wprintf(L"Original string: %ls\n", buf);
bool r = StrTrimW(buf, trim);
if (r == true) {
wprintf(L"The StrTrim() trimmed some characters\n", buf);
} else {
wprintf(L"No characters were trimmed\n", buf);
}
wprintf(L"Trimmed string: %ls\n", buf);
return 0;
}