Visual C++ Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

C++ Examples

CkString
Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
DH Key Exchange
DKIM/DomainKeys
Digital Certificates
Digital Signatures
DSA
Email
Email Object
Encryption
FTP
HTML Conversion
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...
Amazon S3
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

 

 

Split a String using a Delimiter Char

Downloads:

MS Windows Visual C/C++ Libraries
Linux/CentOS C/C++ Libraries
MAC OS X C/C++ Libraries
Solaris C/C++ Libraries
C++ Builder Libraries

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;

 

 

 

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

Mail Component · .NET Mail Component · XML Parser