📄 xtrimtest.cpp
字号:
// XTrimTest.cpp : Defines the entry point for the console application.
//
#include <stdio.h>
#include <tchar.h>
#include "XTrim.h"
int _tmain(int /*argc*/, TCHAR ** /*argv*/)
{
TCHAR * cp = NULL;
TCHAR string1[100];
TCHAR string2[100];
///////////////////////////////////////////////////////////////////////////
// test _tcsltrim
_tprintf(_T("\nTesting _tcsltrim... "));
_tcscpy(string1, _T(" \tThis is a test"));
_tcscpy(string2, _T("This is a test"));
cp = _tcsltrim(string1);
if (cp)
{
if (_tcscmp(string2, cp) == 0)
_tprintf(_T("_tcsltrim OK\n"));
else
_tprintf(_T("ERROR: _tcsltrim failed\n"));
}
else
{
_tprintf(_T("ERROR: _tcsltrim returned NULL\n"));
}
///////////////////////////////////////////////////////////////////////////
// test _tcsrtrim
_tprintf(_T("\n\nTesting _tcsrtrim... "));
_tcscpy(string1, _T("This is a test\t "));
_tcscpy(string2, _T("This is a test"));
cp = _tcsrtrim(string1);
if (cp)
{
if (_tcscmp(string2, cp) == 0)
_tprintf(_T("_tcsrtrim OK\n"));
else
_tprintf(_T("ERROR: _tcsrtrim failed\n"));
}
else
{
_tprintf(_T("ERROR: _tcsrtrim returned NULL\n"));
}
_tprintf(_T("\n\nPress any key to continue"));
_gettchar();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -