Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

CkString
Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
DH Key Exchange
DKIM/DomainKeys
Digital Certificates
Digital Signatures
DSA
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT / HTML Email
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

 

 

Split a String using a Delimiter Char

Download Chilkat C/C++ Libraries for VC++ 9.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 9.0 / x64

Download Chilkat C/C++ Libraries for VC++ 8.0 / Win32

Download Chilkat C/C++ 64-bit Libraries for VC++ 8.0 / x64

Download Chilkat Visual Studio 2005 C/C++ Libs for Windows Mobile, Pocket PC, SmartPhone, WinCE

Download Chilkat C/C++ Libraries for VC++ 7.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 6.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 6.0, Win 95/98/NT4 Compatible

How to split a string using a delimiter.

    CkString str;

    str.append("\"Chilkat Software, Inc.\", http://www.chilkatsoft.com, \"Email, Zip, Encryption, XML\"");

    bool exceptDoubleQuoted = true;
    bool exceptEscaped = true;	// Do not treat characters preceded with a backslash as a delimiter.
    bool keepEmpty = false;	// Do not keep empty fields.
    char delimiter = ',';
    CkStringArray *array = str.split(delimiter,exceptDoubleQuoted,exceptEscaped,keepEmpty);

    int i;
    for (i=0; i<array->get_Count(); i++)
	{
	printf("%d: [%s]\n",i,array->GetString(i));
	}

    // Prints:
    // 0: ["Chilkat Software, Inc."]
    // 1: [ http://www.chilkatsoft.com]
    // 2: [ "Email, Zip, Encryption, XML"]

    // Clean it up...
    CkString tempStr;
    for (i=0; i<array->get_Count(); i++)
	{
	array->GetString(i,tempStr);
	tempStr.trim();				// Trim whitespace from ends.
	tempStr.removeCharOccurances('"');	// Remove double quotes.
	printf("%d: [%s]\n",i,tempStr.getString());
	}

    // Prints:
    // 0: [Chilkat Software, Inc.]
    // 1: [http://www.chilkatsoft.com]
    // 2: [Email, Zip, Encryption, XML]

    delete array;

 

 

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Mail Component · XML Parser