---
product: Chilkat
product_version: 11.7.0
language: c
language_label: C
class: CkString
license: free
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/c_CkStringRef.html
---
# Chilkat CkString — C — v11.7.0

> Chilkat 11.7.0 · language=c · class=CkString
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/CkString.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/c/guide.md`.

## Purpose

The Chilkat string class.

## Object creation, unlocking and error handling

**Create/Dispose**

```c
HCkString instance = CkString_Create();
// ...
CkString_Dispose(instance);
```

`HCkString CkString_Create(void);`

Creates an instance of the HCkString object and returns a handle ("void \*" pointer). The handle is passed in the 1st argument for the functions listed on this page.

`void CkString_Dispose(HCkString handle);`

Objects created by calling CkString_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function. Also, any handle returned by a Chilkat "C" function must also be freed by the application by calling the appropriate Dispose method, such as CkString_Dispose.

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in C.

## Member index

| Member | Kind | Signature |
|---|---|---|
| `NumArabic` | property, read-only | `int CkString_getNumArabic(HCkString cHandle);` |
| `NumAscii` | property, read-only | `int CkString_getNumAscii(HCkString cHandle);` |
| `NumCentralEuro` | property, read-only | `int CkString_getNumCentralEuro(HCkString cHandle);` |
| `NumChinese` | property, read-only | `int CkString_getNumChinese(HCkString cHandle);` |
| `NumCyrillic` | property, read-only | `int CkString_getNumCyrillic(HCkString cHandle);` |
| `NumGreek` | property, read-only | `int CkString_getNumGreek(HCkString cHandle);` |
| `NumHebrew` | property, read-only | `int CkString_getNumHebrew(HCkString cHandle);` |
| `NumJapanese` | property, read-only | `int CkString_getNumJapanese(HCkString cHandle);` |
| `NumKorean` | property, read-only | `int CkString_getNumKorean(HCkString cHandle);` |
| `NumLatin` | property, read-only | `int CkString_getNumLatin(HCkString cHandle);` |
| `NumThai` | property, read-only | `int CkString_getNumThai(HCkString cHandle);` |
| `append` | method | `void CkString_append(HCkString cHandle, const char *str);` |
| `appendAnsi` | method | `void CkString_appendAnsi(HCkString cHandle, const char *str);` |
| `appendChar` | method | `void CkString_appendChar(HCkString cHandle, char c);` |
| `appendCurrentDateRfc822` | method | `void CkString_appendCurrentDateRfc822(HCkString cHandle);` |
| `appendEnc` | method | `void CkString_appendEnc(HCkString cHandle, const char *str, const char *charsetEncoding);` |
| `appendHexData` | method | `void CkString_appendHexData(HCkString cHandle, const unsigned char *byteData, unsigned long numBytes);` |
| `appendInt` | method | `void CkString_appendInt(HCkString cHandle, int n);` |
| `appendN` | method | `void CkString_appendN(HCkString cHandle, const char *str, unsigned long numBytes);` |
| `appendNU` | method | `void CkString_appendNU(HCkString cHandle, const wchar_t * wideStr, int numChars);` |
| `appendRandom` | method | `void CkString_appendRandom(HCkString cHandle, int numBytes, const char *encoding);` |
| `appendStr` | method | `void CkString_appendStr(HCkString cHandle, HCkString strObj);` |
| `appendU` | method | `void CkString_appendU(HCkString cHandle, const wchar_t * unicode);` |
| `appendUtf8` | method | `void CkString_appendUtf8(HCkString cHandle, const char *str);` |
| `base64Decode` | method | `void CkString_base64Decode(HCkString cHandle, const char *charsetEncoding);` |
| `base64DecodeW` | method | `void CkString_base64DecodeW(HCkString cHandle, const wchar_t * charsetEncoding);` |
| `base64Encode` | method | `void CkString_base64Encode(HCkString cHandle, const char *charsetEncoding);` |
| `base64EncodeW` | method | `void CkString_base64EncodeW(HCkString cHandle, const wchar_t * charsetEncoding);` |
| `beginsWith` | method | `BOOL CkString_beginsWith(HCkString cHandle, const char *substr);` |
| `beginsWithStr` | method | `BOOL CkString_beginsWithStr(HCkString cHandle, HCkString strObj);` |
| `beginsWithW` | method | `BOOL CkString_beginsWithW(HCkString cHandle, const wchar_t * str);` |
| `charAt` | method | `char CkString_charAt(HCkString cHandle, int idx);` |
| `charAtU` | method | `wchar_t CkString_charAtU(HCkString cHandle, int idx);` |
| `chopAtFirstChar` | method | `void CkString_chopAtFirstChar(HCkString cHandle, char ch);` |
| `chopAtStr` | method | `void CkString_chopAtStr(HCkString cHandle, HCkString subStrObj);` |
| `clear` | method | `void CkString_clear(HCkString cHandle);` |
| `clone` | method | `HCkString CkString_clone(HCkString cHandle);` |
| `compareStr` | method | `int CkString_compareStr(HCkString cHandle, HCkString str);` |
| `containsSubstring` | method | `BOOL CkString_containsSubstring(HCkString cHandle, const char *substr);` |
| `containsSubstringNoCase` | method | `BOOL CkString_containsSubstringNoCase(HCkString cHandle, const char *substr);` |
| `containsSubstringNoCaseW` | method | `BOOL CkString_containsSubstringNoCaseW(HCkString cHandle, const wchar_t * substr);` |
| `containsSubstringW` | method | `BOOL CkString_containsSubstringW(HCkString cHandle, const wchar_t * substr);` |
| `countCharOccurances` | method | `int CkString_countCharOccurances(HCkString cHandle, char ch);` |
| `decodeXMLSpecial` | method | `void CkString_decodeXMLSpecial(HCkString cHandle);` |
| `doubleValue` | method | `double CkString_doubleValue(HCkString cHandle);` |
| `eliminateChar` | method | `void CkString_eliminateChar(HCkString cHandle, char ansiChar, int startIndex);` |
| `encodeXMLSpecial` | method | `void CkString_encodeXMLSpecial(HCkString cHandle);` |
| `endsWith` | method | `BOOL CkString_endsWith(HCkString cHandle, const char *substr);` |
| `endsWithStr` | method | `BOOL CkString_endsWithStr(HCkString cHandle, HCkString substrObj);` |
| `endsWithW` | method | `BOOL CkString_endsWithW(HCkString cHandle, const wchar_t * s);` |
| `entityDecode` | method | `void CkString_entityDecode(HCkString cHandle);` |
| `entityEncode` | method | `void CkString_entityEncode(HCkString cHandle);` |
| `equals` | method | `BOOL CkString_equals(HCkString cHandle, const char *str);` |
| `equalsIgnoreCase` | method | `BOOL CkString_equalsIgnoreCase(HCkString cHandle, const char *str);` |
| `equalsIgnoreCaseStr` | method | `BOOL CkString_equalsIgnoreCaseStr(HCkString cHandle, HCkString strObj);` |
| `equalsIgnoreCaseW` | method | `BOOL CkString_equalsIgnoreCaseW(HCkString cHandle, const wchar_t * s);` |
| `equalsStr` | method | `BOOL CkString_equalsStr(HCkString cHandle, HCkString strObj);` |
| `equalsW` | method | `BOOL CkString_equalsW(HCkString cHandle, const wchar_t * s);` |
| `getChar` | method | `HCkString CkString_getChar(HCkString cHandle, int idx);` |
| `getEnc` | method | `const char *CkString_getEnc(HCkString cHandle, const char *encoding);` |
| `getNumChars` | method | `int CkString_getNumChars(HCkString cHandle);` |
| `getSizeAnsi` | method | `int CkString_getSizeAnsi(HCkString cHandle);` |
| `getSizeUnicode` | method | `int CkString_getSizeUnicode(HCkString cHandle);` |
| `getSizeUtf8` | method | `int CkString_getSizeUtf8(HCkString cHandle);` |
| `getString` | method | `const char *CkString_getString(HCkString cHandle);` |
| `getStringAnsi` | method | `const char *CkString_getStringAnsi(HCkString cHandle);` |
| `getStringUtf8` | method | `const char *CkString_getStringUtf8(HCkString cHandle);` |
| `getUnicode` | method | `const wchar_t * CkString_getUnicode(HCkString cHandle);` |
| `hexDecode` | method | `void CkString_hexDecode(HCkString cHandle, const char *charsetEncoding);` |
| `hexDecodeW` | method | `void CkString_hexDecodeW(HCkString cHandle, const wchar_t * charsetEncoding);` |
| `hexEncode` | method | `void CkString_hexEncode(HCkString cHandle, const char *charsetEncoding);` |
| `hexEncodeW` | method | `void CkString_hexEncodeW(HCkString cHandle, const wchar_t * charsetEncoding);` |
| `indexOf` | method | `int CkString_indexOf(HCkString cHandle, const char *substr);` |
| `indexOfStr` | method | `int CkString_indexOfStr(HCkString cHandle, HCkString substrObj);` |
| `indexOfW` | method | `int CkString_indexOfW(HCkString cHandle, const wchar_t * s);` |
| `intValue` | method | `int CkString_intValue(HCkString cHandle);` |
| `isEmpty` | method | `BOOL CkString_isEmpty(HCkString cHandle);` |
| `lastChar` | method | `char CkString_lastChar(HCkString cHandle);` |
| `loadFile` | method | `BOOL CkString_loadFile(HCkString cHandle, const char *path, const char *charsetEncoding);` |
| `loadFileW` | method | `BOOL CkString_loadFileW(HCkString cHandle, const wchar_t * path, const wchar_t * charsetEncoding);` |
| `matches` | method | `BOOL CkString_matches(HCkString cHandle, const char *strPattern);` |
| `matchesNoCase` | method | `BOOL CkString_matchesNoCase(HCkString cHandle, const char *strPattern);` |
| `matchesNoCaseW` | method | `BOOL CkString_matchesNoCaseW(HCkString cHandle, const wchar_t * s);` |
| `matchesStr` | method | `BOOL CkString_matchesStr(HCkString cHandle, HCkString strPatternObj);` |
| `matchesW` | method | `BOOL CkString_matchesW(HCkString cHandle, const wchar_t * s);` |
| `minimizeMemory` | method | `void CkString_minimizeMemory(HCkString cHandle);` |
| `obfuscate` | method | `void CkString_obfuscate(HCkString cHandle);` |
| `prepend` | method | `void CkString_prepend(HCkString cHandle, const char *str);` |
| `prependW` | method | `void CkString_prependW(HCkString cHandle, const wchar_t * s);` |
| `punyDecode` | method | `void CkString_punyDecode(HCkString cHandle);` |
| `punyEncode` | method | `void CkString_punyEncode(HCkString cHandle);` |
| `qpDecode` | method | `void CkString_qpDecode(HCkString cHandle, const char *charsetEncoding);` |
| `qpDecodeW` | method | `void CkString_qpDecodeW(HCkString cHandle, const wchar_t * charset);` |
| `qpEncode` | method | `void CkString_qpEncode(HCkString cHandle, const char *charsetEncoding);` |
| `qpEncodeW` | method | `void CkString_qpEncodeW(HCkString cHandle, const wchar_t * charset);` |
| `removeAll` | method | `int CkString_removeAll(HCkString cHandle, HCkString substr);` |
| `removeCharOccurances` | method | `void CkString_removeCharOccurances(HCkString cHandle, char ch);` |
| `removeChunk` | method | `void CkString_removeChunk(HCkString cHandle, int charStartPos, int numChars);` |
| `removeDelimited` | method | `void CkString_removeDelimited(HCkString cHandle, const char *beginDelim, const char *endDelim, BOOL caseSensitive);` |
| `removeFirst` | method | `BOOL CkString_removeFirst(HCkString cHandle, HCkString substr);` |
| `replaceAll` | method | `int CkString_replaceAll(HCkString cHandle, HCkString findStrObj, HCkString replaceStrObj);` |
| `replaceAllOccurances` | method | `int CkString_replaceAllOccurances(HCkString cHandle, const char *findStr, const char *replaceStr);` |
| `replaceAllOccurancesW` | method | `int CkString_replaceAllOccurancesW(HCkString cHandle, const wchar_t * pattern, const wchar_t * replacement);` |
| `replaceChar` | method | `void CkString_replaceChar(HCkString cHandle, char findCh, char replaceCh);` |
| `replaceFirst` | method | `BOOL CkString_replaceFirst(HCkString cHandle, HCkString findStrObj, HCkString replaceStrObj);` |
| `replaceFirstOccurance` | method | `BOOL CkString_replaceFirstOccurance(HCkString cHandle, const char *findStr, const char *replaceStr);` |
| `replaceFirstOccuranceW` | method | `BOOL CkString_replaceFirstOccuranceW(HCkString cHandle, const wchar_t * pattern, const wchar_t * replacement);` |
| `saveToFile` | method | `BOOL CkString_saveToFile(HCkString cHandle, const char *path, const char *charsetEncoding);` |
| `saveToFileW` | method | `BOOL CkString_saveToFileW(HCkString cHandle, const wchar_t * path, const wchar_t * charset);` |
| `setStr` | method | `void CkString_setStr(HCkString cHandle, HCkString s);` |
| `setString` | method | `void CkString_setString(HCkString cHandle, const char *str);` |
| `setStringAnsi` | method | `void CkString_setStringAnsi(HCkString cHandle, const char *s);` |
| `setStringU` | method | `void CkString_setStringU(HCkString cHandle, const wchar_t * unicode);` |
| `setStringUtf8` | method | `void CkString_setStringUtf8(HCkString cHandle, const char *s);` |
| `shorten` | method | `void CkString_shorten(HCkString cHandle, int n);` |
| `split` | method | `HCkStringArray CkString_split(HCkString cHandle, char delimiterChar, BOOL exceptDoubleQuoted, BOOL exceptEscaped, BOOL keepEmpty);` |
| `split2` | method | `HCkStringArray CkString_split2(HCkString cHandle, const char *delimiterChars, BOOL exceptDoubleQuoted, BOOL exceptEscaped, BOOL keepEmpty);` |
| `split2W` | method | `HCkStringArray CkString_split2W(HCkString cHandle, const wchar_t * splitCharSet, BOOL exceptDoubleQuoted, BOOL exceptEscaped, BOOL keepEmpty);` |
| `splitAtWS` | method | `HCkStringArray CkString_splitAtWS(HCkString cHandle);` |
| `substring` | method | `HCkString CkString_substring(HCkString cHandle, int startCharIndex, int numChars);` |
| `toCRLF` | method | `void CkString_toCRLF(HCkString cHandle);` |
| `tokenize` | method | `HCkStringArray CkString_tokenize(HCkString cHandle, const char *punctuation);` |
| `tokenizeW` | method | `HCkStringArray CkString_tokenizeW(HCkString cHandle, const wchar_t * punctuation);` |
| `toLF` | method | `void CkString_toLF(HCkString cHandle);` |
| `toLowerCase` | method | `void CkString_toLowerCase(HCkString cHandle);` |
| `toUpperCase` | method | `void CkString_toUpperCase(HCkString cHandle);` |
| `trim` | method | `void CkString_trim(HCkString cHandle);` |
| `trim2` | method | `void CkString_trim2(HCkString cHandle);` |
| `trimInsideSpaces` | method | `void CkString_trimInsideSpaces(HCkString cHandle);` |
| `unobfuscate` | method | `void CkString_unobfuscate(HCkString cHandle);` |
| `urlDecode` | method | `void CkString_urlDecode(HCkString cHandle, const char *charsetEncoding);` |
| `urlDecodeW` | method | `void CkString_urlDecodeW(HCkString cHandle, const wchar_t * charsetEncoding);` |
| `urlEncode` | method | `void CkString_urlEncode(HCkString cHandle, const char *charsetEncoding);` |
| `urlEncodeW` | method | `void CkString_urlEncodeW(HCkString cHandle, const wchar_t * charsetEncoding);` |

## Properties

### CkString.NumArabic

`Chilkat 11.7.0 · c · CkString · NumArabic · property · read-only · since 9.5.0.25`

```c
int CkString_getNumArabic(HCkString cHandle);
```

The number of Arabic characters contained in this string.

### CkString.NumAscii

`Chilkat 11.7.0 · c · CkString · NumAscii · property · read-only · since 9.5.0.25`

```c
int CkString_getNumAscii(HCkString cHandle);
```

The number of us-ascii characters contained in this string.

### CkString.NumCentralEuro

`Chilkat 11.7.0 · c · CkString · NumCentralEuro · property · read-only · since 9.5.0.25`

```c
int CkString_getNumCentralEuro(HCkString cHandle);
```

The number of Central European and Eastern European characters found in this string. These are characters specific to Polish, Czech, Slovak, Hungarian, Slovene, Croatian, Serbian (Latin script), Romanian and Albanian.

### CkString.NumChinese

`Chilkat 11.7.0 · c · CkString · NumChinese · property · read-only · since 9.5.0.25`

```c
int CkString_getNumChinese(HCkString cHandle);
```

The number of Chinese characters contained in this string.

### CkString.NumCyrillic

`Chilkat 11.7.0 · c · CkString · NumCyrillic · property · read-only · since 9.5.0.25`

```c
int CkString_getNumCyrillic(HCkString cHandle);
```

The number of Cyrillic characters contained in this string. The Cyrillic alphabet also called azbuka, from the old name of the first two letters) is actually a family of alphabets, subsets of which are used by certain East and South Slavic languages `” Belarusian, Bulgarian, Macedonian, Russian, Rusyn, Serbian and Ukrainian`”as well as many other languages of the former Soviet Union, Asia and Eastern Europe.

### CkString.NumGreek

`Chilkat 11.7.0 · c · CkString · NumGreek · property · read-only · since 9.5.0.25`

```c
int CkString_getNumGreek(HCkString cHandle);
```

The number of Greek characters contained in this string.

### CkString.NumHebrew

`Chilkat 11.7.0 · c · CkString · NumHebrew · property · read-only · since 9.5.0.25`

```c
int CkString_getNumHebrew(HCkString cHandle);
```

The number of Hebrew characters contained in this string.

### CkString.NumJapanese

`Chilkat 11.7.0 · c · CkString · NumJapanese · property · read-only · since 9.5.0.25`

```c
int CkString_getNumJapanese(HCkString cHandle);
```

The number of Japanese characters contained in this string.

### CkString.NumKorean

`Chilkat 11.7.0 · c · CkString · NumKorean · property · read-only · since 9.5.0.25`

```c
int CkString_getNumKorean(HCkString cHandle);
```

The number of Korean characters contained in this string.

### CkString.NumLatin

`Chilkat 11.7.0 · c · CkString · NumLatin · property · read-only · since 9.5.0.25`

```c
int CkString_getNumLatin(HCkString cHandle);
```

The number of Latin characters contained in this string. Latin characters include all major Western European languages, such as German, Spanish, French, Italian, Nordic languages, etc.

**Note:** This is the number of chars that are Latin characters that do not fall in the us-ascii range. In other words, the 8bit Latin chars.

### CkString.NumThai

`Chilkat 11.7.0 · c · CkString · NumThai · property · read-only · since 9.5.0.25`

```c
int CkString_getNumThai(HCkString cHandle);
```

The number of Thai characters contained in this string.

## Methods

### CkString.append

`Chilkat 11.7.0 · c · CkString · append · method`

```c
void CkString_append(HCkString cHandle, const char *str);
```

The `str` is appended to end of this instance.

### CkString.appendAnsi

`Chilkat 11.7.0 · c · CkString · appendAnsi · method`

```c
void CkString_appendAnsi(HCkString cHandle, const char *str);
```

Appends an ANSI string to the end of this instance. `str` should always be a null terminated ANSI string regardless of the Utf8 property setting.

### CkString.appendChar

`Chilkat 11.7.0 · c · CkString · appendChar · method`

```c
void CkString_appendChar(HCkString cHandle, char c);
```

Appends a single ANSI character to the end of this instance.

### CkString.appendCurrentDateRfc822

`Chilkat 11.7.0 · c · CkString · appendCurrentDateRfc822 · method`

```c
void CkString_appendCurrentDateRfc822(HCkString cHandle);
```

Appends the current date/time to the end of this instance. The date/time is formatted according to the RFC822 standard, which is the typical format used in the `Date` header field of email. For example: `Fri, 27 Jul 2012 17:41:41 -0500`

### CkString.appendEnc

`Chilkat 11.7.0 · c · CkString · appendEnc · method`

```c
void CkString_appendEnc(HCkString cHandle, const char *str, const char *charsetEncoding);
```

**Full documentation for this method (same in every language):** [Supported Character Encodings](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

Appends a string of any character encoding to the end of this instance. Examples of `charsetEncoding` are: Shift_JIS, windows-1255, iso-8859-2, gb2312, etc. The `str` should point to a null-terminated string that uses the charset specified by `charsetEncoding`.

### CkString.appendHexData

`Chilkat 11.7.0 · c · CkString · appendHexData · method`

```c
void CkString_appendHexData(HCkString cHandle, const unsigned char *byteData, unsigned long numBytes);
```

Converts the binary data to a hexidecimal string representation and appends to the end of this instance. The hex data is appended in 2-byte chunks with 16 bytes per line. For example:

```
6861 6C6C 6861 6C6C 6861 6C6C 6861 6C6C
6861 6C6C 6861 6C6C 6861 6C6C 6861 6C6C
6861 6C6C 6861 6C6C 6861 6C6C 6861 6C6C
```

### CkString.appendInt

`Chilkat 11.7.0 · c · CkString · appendInt · method`

```c
void CkString_appendInt(HCkString cHandle, int n);
```

Appends the decimal string representation of an integer to the end of this instance.

### CkString.appendN

`Chilkat 11.7.0 · c · CkString · appendN · method`

```c
void CkString_appendN(HCkString cHandle, const char *str, unsigned long numBytes);
```

Appends N bytes of character data to the end of this instance. If the Utf8 property is set to `TRUE`, then `str` should point to characters in the utf-8 encoding, otherwise it should point to characters using the ANSI encoding. Note: `numBytes` is not necessarily the number of characters. It is the length, in bytes, of the string to be appended. This method exists to allow for non-null terminated strings to be appended.

### CkString.appendNU

`Chilkat 11.7.0 · c · CkString · appendNU · method`

```c
void CkString_appendNU(HCkString cHandle, const wchar_t * wideStr, int numChars);
```

Append N Unicode characters to the end of this instance. The `wideStr` points to the 2-byte per char Unicode string. The `numChars` is the number of Unicode characters to be appended (not the number of bytes).

### CkString.appendRandom

`Chilkat 11.7.0 · c · CkString · appendRandom · method`

```c
void CkString_appendRandom(HCkString cHandle, int numBytes, const char *encoding);
```

Appends `numBytes` random bytes to the end of this instance. Because arbitrary byte values in the range 0 to 255 do not necessarily represent valid characters, the bytes must be encoded to a string friendly representation such as hex, base64, etc. The `encoding` specifies the encoding to be used. Possible values are `hex`, `base64`, `quoted-printable`, `asc`, or `url`.

### CkString.appendStr

`Chilkat 11.7.0 · c · CkString · appendStr · method`

```c
void CkString_appendStr(HCkString cHandle, HCkString strObj);
```

Appends the contents of `strObj` to the end of this instance.

### CkString.appendU

`Chilkat 11.7.0 · c · CkString · appendU · method`

```c
void CkString_appendU(HCkString cHandle, const wchar_t * unicode);
```

Append a Unicode string to the CkString object.

### CkString.appendUtf8

`Chilkat 11.7.0 · c · CkString · appendUtf8 · method`

```c
void CkString_appendUtf8(HCkString cHandle, const char *str);
```

Appends a utf-8 string to the existing contents of this instance. `str` should always be a null terminated utf-8 string regardless of the Utf8 property setting.

### CkString.base64Decode

`Chilkat 11.7.0 · c · CkString · base64Decode · method`

```c
void CkString_base64Decode(HCkString cHandle, const char *charsetEncoding);
```

**Full documentation for this method (same in every language):** [Supported Character Encodings](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

In-place base64 decodes the string and inteprets the results according to the character encoding specified.

### CkString.base64DecodeW

`Chilkat 11.7.0 · c · CkString · base64DecodeW · method`

```c
void CkString_base64DecodeW(HCkString cHandle, const wchar_t * charsetEncoding);
```

The utf-16 version of base64Decode.

### CkString.base64Encode

`Chilkat 11.7.0 · c · CkString · base64Encode · method`

```c
void CkString_base64Encode(HCkString cHandle, const char *charsetEncoding);
```

**Full documentation for this method (same in every language):** [Supported Character Encodings](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

In-place base64 encodes the string. Internally, the string is first converted to the character encoding specified and then base-64 encoded. Typical `charsetEncoding` values are `utf-8`, `ANSI`, `iso-8859-1`, etc.

### CkString.base64EncodeW

`Chilkat 11.7.0 · c · CkString · base64EncodeW · method`

```c
void CkString_base64EncodeW(HCkString cHandle, const wchar_t * charsetEncoding);
```

The utf-16 version of base64Encode.

### CkString.beginsWith

`Chilkat 11.7.0 · c · CkString · beginsWith · method`

```c
BOOL CkString_beginsWith(HCkString cHandle, const char *substr);
```

Return `TRUE` if this string begins with `substr` (case sensitive), otherwise returns `FALSE`.

### CkString.beginsWithStr

`Chilkat 11.7.0 · c · CkString · beginsWithStr · method`

```c
BOOL CkString_beginsWithStr(HCkString cHandle, HCkString strObj);
```

Returns `TRUE` if the string begins with the contents of `strObj`. Otherwise returns `FALSE`. This method is case sensitive.

### CkString.beginsWithW

`Chilkat 11.7.0 · c · CkString · beginsWithW · method`

```c
BOOL CkString_beginsWithW(HCkString cHandle, const wchar_t * str);
```

The utf-16 version of beginsWith.

### CkString.charAt

`Chilkat 11.7.0 · c · CkString · charAt · method`

```c
char CkString_charAt(HCkString cHandle, int idx);
```

Returns the ANSI character at a specified index.The first character is at index 0.

### CkString.charAtU

`Chilkat 11.7.0 · c · CkString · charAtU · method`

```c
wchar_t CkString_charAtU(HCkString cHandle, int idx);
```

Return the Nth character as a Unicode character.

### CkString.chopAtFirstChar

`Chilkat 11.7.0 · c · CkString · chopAtFirstChar · method`

```c
void CkString_chopAtFirstChar(HCkString cHandle, char ch);
```

Finds the first occurrence of `ch` and discards the characters at and following `ch`.

### CkString.chopAtStr

`Chilkat 11.7.0 · c · CkString · chopAtStr · method`

```c
void CkString_chopAtStr(HCkString cHandle, HCkString subStrObj);
```

Finds the first occurrence of a substring and chops it at that point. The result is that the substring and all subsequent characters are removed from the string.

### CkString.clear

`Chilkat 11.7.0 · c · CkString · clear · method`

```c
void CkString_clear(HCkString cHandle);
```

Clears the string. The string contains 0 characters after calling this method.

### CkString.clone

`Chilkat 11.7.0 · c · CkString · clone · method`

```c
HCkString CkString_clone(HCkString cHandle);
```

Creates a copy of the string. As with any newly created Chilkat object instance returned by a Chilkat method, the returned CkString object must be deleted by the calling application.

Returns `NULL` on failure

### CkString.compareStr

`Chilkat 11.7.0 · c · CkString · compareStr · method`

```c
int CkString_compareStr(HCkString cHandle, HCkString str);
```

Compare two strings. A return value = 0 means they are equal. Return value = 1 indicates that calling object is lexicographically less than argument. Return value = -1 indicates that calling object is lexicographically greater than argument.

### CkString.containsSubstring

`Chilkat 11.7.0 · c · CkString · containsSubstring · method`

```c
BOOL CkString_containsSubstring(HCkString cHandle, const char *substr);
```

Returns `TRUE` if the string contains the specified substring, otherwise returns `FALSE`. The string comparison is case-sensitive.

### CkString.containsSubstringNoCase

`Chilkat 11.7.0 · c · CkString · containsSubstringNoCase · method`

```c
BOOL CkString_containsSubstringNoCase(HCkString cHandle, const char *substr);
```

Same as containsSubstring except the matching is case insensitive.

### CkString.containsSubstringNoCaseW

`Chilkat 11.7.0 · c · CkString · containsSubstringNoCaseW · method`

```c
BOOL CkString_containsSubstringNoCaseW(HCkString cHandle, const wchar_t * substr);
```

The utf-16 version of containsSubstringNoCase.

### CkString.containsSubstringW

`Chilkat 11.7.0 · c · CkString · containsSubstringW · method`

```c
BOOL CkString_containsSubstringW(HCkString cHandle, const wchar_t * substr);
```

The utf-16 version of containsSubstring.

### CkString.countCharOccurances

`Chilkat 11.7.0 · c · CkString · countCharOccurances · method`

```c
int CkString_countCharOccurances(HCkString cHandle, char ch);
```

Returns the number of occurrences of the specified ANSI char.

### CkString.decodeXMLSpecial

`Chilkat 11.7.0 · c · CkString · decodeXMLSpecial · method`

```c
void CkString_decodeXMLSpecial(HCkString cHandle);
```

Decodes XML special characters. For example, < is converted to '<'

### CkString.doubleValue

`Chilkat 11.7.0 · c · CkString · doubleValue · method`

```c
double CkString_doubleValue(HCkString cHandle);
```

Converts the string to a double and returns the value.

### CkString.eliminateChar

`Chilkat 11.7.0 · c · CkString · eliminateChar · method`

```c
void CkString_eliminateChar(HCkString cHandle, char ansiChar, int startIndex);
```

Eliminate all occurrences of a particular ANSI character.

### CkString.encodeXMLSpecial

`Chilkat 11.7.0 · c · CkString · encodeXMLSpecial · method`

```c
void CkString_encodeXMLSpecial(HCkString cHandle);
```

Encodes XML special characters. For example, '<' is converted to <

### CkString.endsWith

`Chilkat 11.7.0 · c · CkString · endsWith · method`

```c
BOOL CkString_endsWith(HCkString cHandle, const char *substr);
```

Returns `TRUE` if the string ends with `substr` (case-sensitive). Otherwise returns `FALSE`.

### CkString.endsWithStr

`Chilkat 11.7.0 · c · CkString · endsWithStr · method`

```c
BOOL CkString_endsWithStr(HCkString cHandle, HCkString substrObj);
```

Returns `TRUE` if the string ends with the specified substring, otherwise returns `FALSE`.

### CkString.endsWithW

`Chilkat 11.7.0 · c · CkString · endsWithW · method`

```c
BOOL CkString_endsWithW(HCkString cHandle, const wchar_t * s);
```

The utf-16 version of endsWith.

### CkString.entityDecode

`Chilkat 11.7.0 · c · CkString · entityDecode · method`

```c
void CkString_entityDecode(HCkString cHandle);
```

Decodes any HTML entities found within the string, replacing them with the characters represented.

### CkString.entityEncode

`Chilkat 11.7.0 · c · CkString · entityEncode · method`

```c
void CkString_entityEncode(HCkString cHandle);
```

HTML encodes any characters that are special to HTML or cannot be represented by 7-bit us-ascii.

### CkString.equals

`Chilkat 11.7.0 · c · CkString · equals · method`

```c
BOOL CkString_equals(HCkString cHandle, const char *str);
```

Returns `TRUE` if the strings are equal, otherwise returns `FALSE`. (case-sensitive)

### CkString.equalsIgnoreCase

`Chilkat 11.7.0 · c · CkString · equalsIgnoreCase · method`

```c
BOOL CkString_equalsIgnoreCase(HCkString cHandle, const char *str);
```

Returns `TRUE` if the strings are equal, otherwise returns `FALSE`. (case-insensitive)

### CkString.equalsIgnoreCaseStr

`Chilkat 11.7.0 · c · CkString · equalsIgnoreCaseStr · method`

```c
BOOL CkString_equalsIgnoreCaseStr(HCkString cHandle, HCkString strObj);
```

Returns `TRUE` if the strings are equal, otherwise returns `FALSE` (case-insensitive)

### CkString.equalsIgnoreCaseW

`Chilkat 11.7.0 · c · CkString · equalsIgnoreCaseW · method`

```c
BOOL CkString_equalsIgnoreCaseW(HCkString cHandle, const wchar_t * s);
```

The utf-16 version of equalsIgnoreCase.

### CkString.equalsStr

`Chilkat 11.7.0 · c · CkString · equalsStr · method`

```c
BOOL CkString_equalsStr(HCkString cHandle, HCkString strObj);
```

Returns `TRUE` if the strings are equal, otherwise returns `FALSE`. (case-sensitive)

### CkString.equalsW

`Chilkat 11.7.0 · c · CkString · equalsW · method`

```c
BOOL CkString_equalsW(HCkString cHandle, const wchar_t * s);
```

The utf-16 version of the `equals` method.

### CkString.getChar

`Chilkat 11.7.0 · c · CkString · getChar · method`

```c
HCkString CkString_getChar(HCkString cHandle, int idx);
```

Returns a new CkString object containing the Nth character. (Note, it does not contain the Nth byte, but the Nth character.) For languages such as Chinese, Japanese, etc. individual characters are represented by multiple or varying number of bytes.

Returns `NULL` on failure

### CkString.getEnc

`Chilkat 11.7.0 · c · CkString · getEnc · method`

```c
const char *CkString_getEnc(HCkString cHandle, const char *encoding);
```

Returns the string as a null-terminated byte sequence in the character encoding specified by `encoding`. The `encoding` can be any encoding specified at the link below, except for charsets that contain 0 (null) bytes in individual character byte representations, such as utf-16, utf-32, etc.

See also:

- [Character Encodings (Charsets) Supported by Chilkat](http://cknotes.com/chilkat-charsets-character-encodings-supported/)

### CkString.getNumChars

`Chilkat 11.7.0 · c · CkString · getNumChars · method`

```c
int CkString_getNumChars(HCkString cHandle);
```

Returns the number of characters in the string.

### CkString.getSizeAnsi

`Chilkat 11.7.0 · c · CkString · getSizeAnsi · method`

```c
int CkString_getSizeAnsi(HCkString cHandle);
```

Returns the size, in bytes, of the ANSI encoding of the string.

### CkString.getSizeUnicode

`Chilkat 11.7.0 · c · CkString · getSizeUnicode · method`

```c
int CkString_getSizeUnicode(HCkString cHandle);
```

Returns the size, in bytes, of the Unicode encoding of the string.

### CkString.getSizeUtf8

`Chilkat 11.7.0 · c · CkString · getSizeUtf8 · method`

```c
int CkString_getSizeUtf8(HCkString cHandle);
```

Returns the size, in bytes, of the utf-8 encoding of the string.

### CkString.getString

`Chilkat 11.7.0 · c · CkString · getString · method`

```c
const char *CkString_getString(HCkString cHandle);
```

Returns the contents of this instance.

### CkString.getStringAnsi

`Chilkat 11.7.0 · c · CkString · getStringAnsi · method`

```c
const char *CkString_getStringAnsi(HCkString cHandle);
```

Returns the string as null-terminated ANSI.

### CkString.getStringUtf8

`Chilkat 11.7.0 · c · CkString · getStringUtf8 · method`

```c
const char *CkString_getStringUtf8(HCkString cHandle);
```

Returns the string as null-terminated utf-8.

### CkString.getUnicode

`Chilkat 11.7.0 · c · CkString · getUnicode · method`

```c
const wchar_t * CkString_getUnicode(HCkString cHandle);
```

Return a pointer to memory containing the string in Unicode.

### CkString.hexDecode

`Chilkat 11.7.0 · c · CkString · hexDecode · method`

```c
void CkString_hexDecode(HCkString cHandle, const char *charsetEncoding);
```

**Full documentation for this method (same in every language):** [Supported Character Encodings](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

Hex decodes a string and inteprets the bytes according to the character encoding specified.

### CkString.hexDecodeW

`Chilkat 11.7.0 · c · CkString · hexDecodeW · method`

```c
void CkString_hexDecodeW(HCkString cHandle, const wchar_t * charsetEncoding);
```

The utf-16 version of hexDecode.

### CkString.hexEncode

`Chilkat 11.7.0 · c · CkString · hexEncode · method`

```c
void CkString_hexEncode(HCkString cHandle, const char *charsetEncoding);
```

**Full documentation for this method (same in every language):** [Supported Character Encodings](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

Converts the string to the character encoding specified and replaces the string contents with the hex encoding of the character data.

### CkString.hexEncodeW

`Chilkat 11.7.0 · c · CkString · hexEncodeW · method`

```c
void CkString_hexEncodeW(HCkString cHandle, const wchar_t * charsetEncoding);
```

The utf-16 version of hexEncode.

### CkString.indexOf

`Chilkat 11.7.0 · c · CkString · indexOf · method`

```c
int CkString_indexOf(HCkString cHandle, const char *substr);
```

Returns the index of the first occurrence of a substring. Returns -1 if not found.

### CkString.indexOfStr

`Chilkat 11.7.0 · c · CkString · indexOfStr · method`

```c
int CkString_indexOfStr(HCkString cHandle, HCkString substrObj);
```

Returns the index of the first occurrence of a substring. Returns -1 if not found.

### CkString.indexOfW

`Chilkat 11.7.0 · c · CkString · indexOfW · method`

```c
int CkString_indexOfW(HCkString cHandle, const wchar_t * s);
```

The utf-16 version of `indexOf`.

### CkString.intValue

`Chilkat 11.7.0 · c · CkString · intValue · method`

```c
int CkString_intValue(HCkString cHandle);
```

Converts the string to an integer and returns the integer value.

### CkString.isEmpty

`Chilkat 11.7.0 · c · CkString · isEmpty · method`

```c
BOOL CkString_isEmpty(HCkString cHandle);
```

Returns `TRUE` if the string object is empty, otherwise returns `FALSE`.

### CkString.lastChar

`Chilkat 11.7.0 · c · CkString · lastChar · method`

```c
char CkString_lastChar(HCkString cHandle);
```

Returns the last ANSI character in the string.

### CkString.loadFile

`Chilkat 11.7.0 · c · CkString · loadFile · method`

```c
BOOL CkString_loadFile(HCkString cHandle, const char *path, const char *charsetEncoding);
```

**Full documentation for this method (same in every language):** [Supported Character Encodings](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

Load the contents of a text file into the CkString object. The string is cleared before loading. The character encoding of the text file is specified by `charsetEncoding`. This method allows for text files in any charset to be loaded: utf-8, Unicode, Shift_JIS, iso-8859-1, etc.

Returns TRUE for success, FALSE for failure.

### CkString.loadFileW

`Chilkat 11.7.0 · c · CkString · loadFileW · method`

```c
BOOL CkString_loadFileW(HCkString cHandle, const wchar_t * path, const wchar_t * charsetEncoding);
```

The utf-16 version of loadFile.

Returns TRUE for success, FALSE for failure.

### CkString.matches

`Chilkat 11.7.0 · c · CkString · matches · method`

```c
BOOL CkString_matches(HCkString cHandle, const char *strPattern);
```

Returns `TRUE` if the string matches the `strPattern`, which may contain one or more asterisk wildcard characters. Returns `FALSE` if the string does not match. This method is case-sensitive.

### CkString.matchesNoCase

`Chilkat 11.7.0 · c · CkString · matchesNoCase · method`

```c
BOOL CkString_matchesNoCase(HCkString cHandle, const char *strPattern);
```

Returns `TRUE` if the string matches the `strPattern`, which may contain one or more asterisk wildcard characters. Returns `FALSE` if the string does not match. This method is case-insensitive.

### CkString.matchesNoCaseW

`Chilkat 11.7.0 · c · CkString · matchesNoCaseW · method`

```c
BOOL CkString_matchesNoCaseW(HCkString cHandle, const wchar_t * s);
```

The utf-16 version of matchesNoCase.

### CkString.matchesStr

`Chilkat 11.7.0 · c · CkString · matchesStr · method`

```c
BOOL CkString_matchesStr(HCkString cHandle, HCkString strPatternObj);
```

Returns `TRUE` if the string matches a pattern, otherwise returns `FALSE`. The pattern may contain any number of wildcard '\*' characters which represent 0 or more occurrences of any character. This method is case-sensitive.

### CkString.matchesW

`Chilkat 11.7.0 · c · CkString · matchesW · method`

```c
BOOL CkString_matchesW(HCkString cHandle, const wchar_t * s);
```

The utf-16 version of the `matches` method.

### CkString.minimizeMemory

`Chilkat 11.7.0 · c · CkString · minimizeMemory · method`

```c
void CkString_minimizeMemory(HCkString cHandle);
```

Minimizes the amount of memory consumed by this object. For example, consider the following: A CkString object is loaded with the contents of a text file. The `replaceAllOccurances` method is called, replacing longer substrings with shorter replacements. The actual string length will become shorter than the internal buffer space that is allocated. The minimizeMemory method will, if necessary, allocate a new internal buffer that is exactly the size needed to hold the current contents of the string, copy the string to the new internal buffer, and deallocate the old buffer.

### CkString.obfuscate

`Chilkat 11.7.0 · c · CkString · obfuscate · method`

```c
void CkString_obfuscate(HCkString cHandle);
```

Obfuscates the string. (The unobfuscate method can be called to reverse the obfuscation to restore the original string.)

The Chilkat string obfuscation algorithm works by taking the utf-8 bytes of the string, base64 encoding it, and then scrambling the letters of the base64 encoded string. It is deterministic in that the same string will always obfuscate to the same result. It is not a secure way of encrypting a string. It is only meant to be a simple means of transforming a string into something unintelligible.

### CkString.prepend

`Chilkat 11.7.0 · c · CkString · prepend · method`

```c
void CkString_prepend(HCkString cHandle, const char *str);
```

Prepends `str` to this instance.

### CkString.prependW

`Chilkat 11.7.0 · c · CkString · prependW · method`

```c
void CkString_prependW(HCkString cHandle, const wchar_t * s);
```

The utf-16 version of the `prepend` method.

### CkString.punyDecode

`Chilkat 11.7.0 · c · CkString · punyDecode · method · since 9.5.0.52`

```c
void CkString_punyDecode(HCkString cHandle);
```

In-place decodes the string from punycode.

### CkString.punyEncode

`Chilkat 11.7.0 · c · CkString · punyEncode · method · since 9.5.0.52`

```c
void CkString_punyEncode(HCkString cHandle);
```

In-place encodes the string to punycode.

### CkString.qpDecode

`Chilkat 11.7.0 · c · CkString · qpDecode · method`

```c
void CkString_qpDecode(HCkString cHandle, const char *charsetEncoding);
```

**Full documentation for this method (same in every language):** [Supported Character Encodings](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

Quoted-printable decodes the string and interprets the resulting character data according to the specified character encoding. The result is that the quoted-printable string is in-place decoded.

### CkString.qpDecodeW

`Chilkat 11.7.0 · c · CkString · qpDecodeW · method`

```c
void CkString_qpDecodeW(HCkString cHandle, const wchar_t * charset);
```

The utf-16 version of the qpDecode method.

### CkString.qpEncode

`Chilkat 11.7.0 · c · CkString · qpEncode · method`

```c
void CkString_qpEncode(HCkString cHandle, const char *charsetEncoding);
```

**Full documentation for this method (same in every language):** [Supported Character Encodings](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

Quoted-printable encodes the string. The string is first converted to the charset specified, and those bytes are QP-encoded. The contents of the string are replaced with the QP-encoded result.

### CkString.qpEncodeW

`Chilkat 11.7.0 · c · CkString · qpEncodeW · method`

```c
void CkString_qpEncodeW(HCkString cHandle, const wchar_t * charset);
```

The utf-16 version of the qpEncode method.

### CkString.removeAll

`Chilkat 11.7.0 · c · CkString · removeAll · method`

```c
int CkString_removeAll(HCkString cHandle, HCkString substr);
```

Removes all occurrences of `substr`.

### CkString.removeCharOccurances

`Chilkat 11.7.0 · c · CkString · removeCharOccurances · method`

```c
void CkString_removeCharOccurances(HCkString cHandle, char ch);
```

Removes all occurrences of a specific ANSI character from the string.

### CkString.removeChunk

`Chilkat 11.7.0 · c · CkString · removeChunk · method`

```c
void CkString_removeChunk(HCkString cHandle, int charStartPos, int numChars);
```

Removes a chunk of characters specified by starting index and length.

### CkString.removeDelimited

`Chilkat 11.7.0 · c · CkString · removeDelimited · method · since 9.5.0.52`

```c
void CkString_removeDelimited(HCkString cHandle, const char *beginDelim, const char *endDelim, BOOL caseSensitive);
```

Remove all occurrences of strings delimited by `beginDelim` and `endDelim`. Also removes the delimiters.

### CkString.removeFirst

`Chilkat 11.7.0 · c · CkString · removeFirst · method`

```c
BOOL CkString_removeFirst(HCkString cHandle, HCkString substr);
```

Removes the first occurrence of a substring.

### CkString.replaceAll

`Chilkat 11.7.0 · c · CkString · replaceAll · method`

```c
int CkString_replaceAll(HCkString cHandle, HCkString findStrObj, HCkString replaceStrObj);
```

Replaces all occurrences of a substring with another. The replacement string is allowed to be empty or different in length.

### CkString.replaceAllOccurances

`Chilkat 11.7.0 · c · CkString · replaceAllOccurances · method`

```c
int CkString_replaceAllOccurances(HCkString cHandle, const char *findStr, const char *replaceStr);
```

Replaces all occurrences of a substring with another substring. The replacement string is allowed to be empty or different in length.

### CkString.replaceAllOccurancesW

`Chilkat 11.7.0 · c · CkString · replaceAllOccurancesW · method`

```c
int CkString_replaceAllOccurancesW(HCkString cHandle, const wchar_t * pattern, const wchar_t * replacement);
```

The utf-16 version of the replaceAllOccurances method.

### CkString.replaceChar

`Chilkat 11.7.0 · c · CkString · replaceChar · method`

```c
void CkString_replaceChar(HCkString cHandle, char findCh, char replaceCh);
```

Replaces all occurrences of a specified ANSI character with another.

### CkString.replaceFirst

`Chilkat 11.7.0 · c · CkString · replaceFirst · method`

```c
BOOL CkString_replaceFirst(HCkString cHandle, HCkString findStrObj, HCkString replaceStrObj);
```

Replaces the first occurrence of a substring with another. The replacement string is allowed to be empty or different in length.

### CkString.replaceFirstOccurance

`Chilkat 11.7.0 · c · CkString · replaceFirstOccurance · method`

```c
BOOL CkString_replaceFirstOccurance(HCkString cHandle, const char *findStr, const char *replaceStr);
```

Replaces the first occurrence of a substring with another. The replacement string is allowed to be empty or different in length. (Chilkat is aware of the misspelling of the word `occurrence`, but unfortunately it is too late to change..)

### CkString.replaceFirstOccuranceW

`Chilkat 11.7.0 · c · CkString · replaceFirstOccuranceW · method`

```c
BOOL CkString_replaceFirstOccuranceW(HCkString cHandle, const wchar_t * pattern, const wchar_t * replacement);
```

The utf-16 version of replaceFirstOccurrance. (Chilkat is aware of the misspelling of the word `occurrence`, but unfortunately it is too late to change..)

### CkString.saveToFile

`Chilkat 11.7.0 · c · CkString · saveToFile · method`

```c
BOOL CkString_saveToFile(HCkString cHandle, const char *path, const char *charsetEncoding);
```

**Full documentation for this method (same in every language):** [Supported Character Encodings](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

Saves the string to a file using the character encoding specified by `charsetEncoding`. If a file of the same name exists, it is overwritten. For charsets such as `utf-8`, `utf-16`, or others that have a possible BOM/preamble, the preamble is output by default. To exclude the BOM/preamble, prepend `no-bom-` to the charset name. For example `no-bom-utf-8`.

Returns TRUE for success, FALSE for failure.

### CkString.saveToFileW

`Chilkat 11.7.0 · c · CkString · saveToFileW · method`

```c
BOOL CkString_saveToFileW(HCkString cHandle, const wchar_t * path, const wchar_t * charset);
```

The utf-16 version of the saveToFile method.

Returns TRUE for success, FALSE for failure.

### CkString.setStr

`Chilkat 11.7.0 · c · CkString · setStr · method`

```c
void CkString_setStr(HCkString cHandle, HCkString s);
```

Replaces the contents of the string with another.

### CkString.setString

`Chilkat 11.7.0 · c · CkString · setString · method`

```c
void CkString_setString(HCkString cHandle, const char *str);
```

Clears the contents of this instance and appends `str`.

### CkString.setStringAnsi

`Chilkat 11.7.0 · c · CkString · setStringAnsi · method`

```c
void CkString_setStringAnsi(HCkString cHandle, const char *s);
```

Set the CkString object from an ANSI string.

### CkString.setStringU

`Chilkat 11.7.0 · c · CkString · setStringU · method`

```c
void CkString_setStringU(HCkString cHandle, const wchar_t * unicode);
```

Set the CkString object from a Unicode string.

### CkString.setStringUtf8

`Chilkat 11.7.0 · c · CkString · setStringUtf8 · method`

```c
void CkString_setStringUtf8(HCkString cHandle, const char *s);
```

Set the string object from a utf-8 string.

### CkString.shorten

`Chilkat 11.7.0 · c · CkString · shorten · method`

```c
void CkString_shorten(HCkString cHandle, int n);
```

Discards the last N characters.

### CkString.split

`Chilkat 11.7.0 · c · CkString · split · method`

```c
HCkStringArray CkString_split(HCkString cHandle, char delimiterChar, BOOL exceptDoubleQuoted, BOOL exceptEscaped, BOOL keepEmpty);
```

Splits a string into a collection of strings using a delimiter character. If `exceptEscaped` is `TRUE`, then delimiter chars escaped with a backslash are ignored. If `exceptDoubleQuoted` is `TRUE`, then delimiter chars inside quotes are ignored. If `keepEmpty` is `FALSE`, then empty strings are excluded from being added to the returned CkStringArray object.

Returns `NULL` on failure

### CkString.split2

`Chilkat 11.7.0 · c · CkString · split2 · method`

```c
HCkStringArray CkString_split2(HCkString cHandle, const char *delimiterChars, BOOL exceptDoubleQuoted, BOOL exceptEscaped, BOOL keepEmpty);
```

Same as `split`, except a set of characters can be used for delimiters.

Returns `NULL` on failure

### CkString.split2W

`Chilkat 11.7.0 · c · CkString · split2W · method`

```c
HCkStringArray CkString_split2W(HCkString cHandle, const wchar_t * splitCharSet, BOOL exceptDoubleQuoted, BOOL exceptEscaped, BOOL keepEmpty);
```

The utf-16 version of the split2 method.

Returns `NULL` on failure

### CkString.splitAtWS

`Chilkat 11.7.0 · c · CkString · splitAtWS · method`

```c
HCkStringArray CkString_splitAtWS(HCkString cHandle);
```

Equivalent to split2(`\t\r\n`,true,true,false)

Returns `NULL` on failure

### CkString.substring

`Chilkat 11.7.0 · c · CkString · substring · method`

```c
HCkString CkString_substring(HCkString cHandle, int startCharIndex, int numChars);
```

Returns a substring specified by starting character position and number of characters. (The 1st char is at index 0.)

Returns `NULL` on failure

### CkString.toCRLF

`Chilkat 11.7.0 · c · CkString · toCRLF · method`

```c
void CkString_toCRLF(HCkString cHandle);
```

Converts all line endings to CRLF.

### CkString.tokenize

`Chilkat 11.7.0 · c · CkString · tokenize · method`

```c
HCkStringArray CkString_tokenize(HCkString cHandle, const char *punctuation);
```

Tokenizes a string. The string is split at whitespace characters, and any single punctuation character is returned as a separate token. For example, this string:  
CkStringArray \*CkString::tokenize(char \*punctuation) const  

is tokenized to  

CkStringArray  
\*  
CkString  
:  
:  
tokenize  
(  
\*  
punctuation  
)  
const

Returns `NULL` on failure

### CkString.tokenizeW

`Chilkat 11.7.0 · c · CkString · tokenizeW · method`

```c
HCkStringArray CkString_tokenizeW(HCkString cHandle, const wchar_t * punctuation);
```

The utf-16 version of the `tokenize` method.

Returns `NULL` on failure

### CkString.toLF

`Chilkat 11.7.0 · c · CkString · toLF · method`

```c
void CkString_toLF(HCkString cHandle);
```

Converts all line endings to bare-LF (Unix/Linux style line endings).

### CkString.toLowerCase

`Chilkat 11.7.0 · c · CkString · toLowerCase · method`

```c
void CkString_toLowerCase(HCkString cHandle);
```

Converts the string to lowercase.

### CkString.toUpperCase

`Chilkat 11.7.0 · c · CkString · toUpperCase · method`

```c
void CkString_toUpperCase(HCkString cHandle);
```

Converts the string to uppercase.

### CkString.trim

`Chilkat 11.7.0 · c · CkString · trim · method`

```c
void CkString_trim(HCkString cHandle);
```

Trim SPACE and Tab characters from both ends of the string.

### CkString.trim2

`Chilkat 11.7.0 · c · CkString · trim2 · method`

```c
void CkString_trim2(HCkString cHandle);
```

Trim SPACE, Tab, CR, and LF characters from both ends of the string.

### CkString.trimInsideSpaces

`Chilkat 11.7.0 · c · CkString · trimInsideSpaces · method`

```c
void CkString_trimInsideSpaces(HCkString cHandle);
```

Replaces all tabs, CR's, and LF's, with SPACE chars, and removes extra SPACE's so there are no occurrences of more than one SPACE char in a row.

### CkString.unobfuscate

`Chilkat 11.7.0 · c · CkString · unobfuscate · method`

```c
void CkString_unobfuscate(HCkString cHandle);
```

Unobfuscates the string.

The Chilkat string obfuscation algorithm works by taking the utf-8 bytes of the string, base64 encoding it, and then scrambling the letters of the base64 encoded string. It is deterministic in that the same string will always obfuscate to the same result. It is not a secure way of encrypting a string. It is only meant to be a simple means of transforming a string into something unintelligible.

### CkString.urlDecode

`Chilkat 11.7.0 · c · CkString · urlDecode · method`

```c
void CkString_urlDecode(HCkString cHandle, const char *charsetEncoding);
```

**Full documentation for this method (same in every language):** [Supported Character Encodings](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

URL decodes the string and interprets the resulting byte data in the specified charset encoding.

### CkString.urlDecodeW

`Chilkat 11.7.0 · c · CkString · urlDecodeW · method`

```c
void CkString_urlDecodeW(HCkString cHandle, const wchar_t * charsetEncoding);
```

The utf-16 version of the urlDecode method.

### CkString.urlEncode

`Chilkat 11.7.0 · c · CkString · urlEncode · method`

```c
void CkString_urlEncode(HCkString cHandle, const char *charsetEncoding);
```

**Full documentation for this method (same in every language):** [Supported Character Encodings](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/charsets_supported_by_chilkat.md)

URL encodes the string. The string is first converted to the specified charset encoding, and those bytes are URL-encoded. The contents of the string are replaced with the URL-encoded result.

### CkString.urlEncodeW

`Chilkat 11.7.0 · c · CkString · urlEncodeW · method`

```c
void CkString_urlEncodeW(HCkString cHandle, const wchar_t * charsetEncoding);
```

The utf-16 version of the urlEncode method.

## Related classes

[`StringArray`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/c/classes/StringArray.md)

