Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Get String Length for ANSI, utf-8, and UnicodeDownloads: 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 get the string length in bytes, and in number of characters. CkString str; str.append(""); printf("ANSI # Bytes: %d\n",str.getSizeAnsi()); printf("utf-8 # Bytes: %d\n",str.getSizeUtf8()); printf("Unicode # Bytes: %d\n",str.getSizeUnicode()); printf("Number of chars: %d\n",str.getNumChars()); // Prints: // ANSI # Bytes: 4 // utf-8 # Bytes: 8 // Unicode # Bytes: 8 // Number of chars: 4
|
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.