- acf-02.zip
- Acf
- docs
- lib
- samples
- Corlib
- Arrays
- Boxing
- Delegate
- Environment
- Event
- FileSystem
- Foreach
- MFCReadWrite
- ReadWrite
- Samples.sln
- Samples.txt
- Strings
- Threads
- Timer
- src
- Corlib
- Pal
- tools
- vcide
- AppWizards
- ConsoleApp
- ConsoleApp.txt
- VCProjects
- ACF
- AcfAppWiz.vsdir
- AcfAppWiz.ico
- AcfAppWiz.vsdir
- AcfAppWiz.vsz
- VCWizards
- AcfAppWiz
- Scripts
- 1033
- Templates
- 1033
- readme.txt
- usertype.dat
- acf-01.zip
|
// Strings.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <acfbcl.h>
using namespace Acf;
using namespace Acf::Text;
int _tmain(int argc, _TCHAR* argv[])
{
//
// Test String
//
Console::WriteLine(L"String:");
StringPtr s = new String(L"The quick brown fox jumps over the lazy dog");
s = s->Insert(19, L" happily");
s = s->Remove(10, 6);
s = s->Replace(L"jumps", L"leaps");
s = String::Format(L"{0} {1} times in {2} minutes", s, Int32::ToString(17), Int32::ToString(2));
// Insert a comma after the word "dog"
int intPos = s->IndexOf(L"dog");
if (intPos > 0)
s = s->Insert(intPos + 3, L",");
Console::WriteLine(s);
Console::WriteLine();
//
// Test StringBuilder
//
Console::WriteLine(L"StringBuilder:");
StringBuilderPtr sb = new StringBuilder();
sb->Append(L"The quick brown fox jumps over the lazy dog");
sb->Insert(19, L" happily");
sb->Remove(10, 6);
sb->Replace(L"jumps", L"leaps");
sb->AppendFormat(L" {0} times in {1} minutes", Int32::ToString(17), Int32::ToString(2));
// Insert a comma after the word "dog"
intPos = sb->ToString()->IndexOf(L"dog");
if (intPos > 0)
sb->Insert(intPos + 3, L",");
Console::WriteLine(sb->ToString());
Console::Read();
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Yingle Jia is a software engineer located in Beijing, China. He currently works at IBM CSDL (China Software Development Lab). His interests include C++/COM/C#/.NET/XML, etc. He likes coding and writing.
He is the creator of ACF (Another C++ Framework) project. See
http://acfproj.sourceforge.net/.
He also has a blog at
http://blogs.wwwcoder.com/yljia/