mirror of
https://github.com/janbodnar/Windows-API-examples.git
synced 2024-11-24 11:25:30 +00:00
Create winapi_shell_trim.c
This commit is contained in:
parent
630449cb64
commit
b78d2a077e
28
strings/winapi_shell_trim.c
Normal file
28
strings/winapi_shell_trim.c
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user