---
product: Chilkat
product_version: 11.7.0
language: delphidll
language_label: Delphi DLL
class: CkString
license: free
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/dd_CkStringRef.html
---
# Chilkat CkString — Delphi DLL — v11.7.0

> Chilkat 11.7.0 · language=delphidll · 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/delphidll/guide.md`.

## Purpose

The Chilkat string class.

## Object creation, unlocking and error handling

**Create/Dispose**

```pascal
var
myObject: HCkString;

begin
myObject := CkString_Create();

// ...

CkString_Dispose(myObject);
end;
```

`function CkString_Create: HCkString; stdcall;`

Creates an instance of the HCkString object and returns a handle (i.e. a Pointer). The handle is passed in the 1st argument for the functions listed on this page.

`procedure CkString_Dispose(handle: HCkString); stdcall;`

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.

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 Delphi DLL.

## Member index

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

## Properties

### CkString.NumArabic

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

```pascal
function CkString_getNumArabic(objHandle: HCkString): Integer; stdcall;
```

The number of Arabic characters contained in this string.

### CkString.NumAscii

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

```pascal
function CkString_getNumAscii(objHandle: HCkString): Integer; stdcall;
```

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

### CkString.NumCentralEuro

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

```pascal
function CkString_getNumCentralEuro(objHandle: HCkString): Integer; stdcall;
```

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 · delphidll · CkString · NumChinese · property · read-only · since 9.5.0.25`

```pascal
function CkString_getNumChinese(objHandle: HCkString): Integer; stdcall;
```

The number of Chinese characters contained in this string.

### CkString.NumCyrillic

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

```pascal
function CkString_getNumCyrillic(objHandle: HCkString): Integer; stdcall;
```

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 · delphidll · CkString · NumGreek · property · read-only · since 9.5.0.25`

```pascal
function CkString_getNumGreek(objHandle: HCkString): Integer; stdcall;
```

The number of Greek characters contained in this string.

### CkString.NumHebrew

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

```pascal
function CkString_getNumHebrew(objHandle: HCkString): Integer; stdcall;
```

The number of Hebrew characters contained in this string.

### CkString.NumJapanese

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

```pascal
function CkString_getNumJapanese(objHandle: HCkString): Integer; stdcall;
```

The number of Japanese characters contained in this string.

### CkString.NumKorean

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

```pascal
function CkString_getNumKorean(objHandle: HCkString): Integer; stdcall;
```

The number of Korean characters contained in this string.

### CkString.NumLatin

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

```pascal
function CkString_getNumLatin(objHandle: HCkString): Integer; stdcall;
```

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 · delphidll · CkString · NumThai · property · read-only · since 9.5.0.25`

```pascal
function CkString_getNumThai(objHandle: HCkString): Integer; stdcall;
```

The number of Thai characters contained in this string.

## Methods

### CkString.append

`Chilkat 11.7.0 · delphidll · CkString · append · method`

```pascal
procedure CkString_append(objHandle: HCkString;
    str: pbyte) stdcall;
```

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

### CkString.appendAnsi

`Chilkat 11.7.0 · delphidll · CkString · appendAnsi · method`

```pascal
procedure CkString_appendAnsi(objHandle: HCkString;
    str: pbyte) stdcall;
```

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 · delphidll · CkString · appendChar · method`

```pascal
procedure CkString_appendChar(objHandle: HCkString;
    c: Char) stdcall;
```

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

### CkString.appendCurrentDateRfc822

`Chilkat 11.7.0 · delphidll · CkString · appendCurrentDateRfc822 · method`

```pascal
procedure CkString_appendCurrentDateRfc822(objHandle: HCkString) stdcall;
```

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 · delphidll · CkString · appendEnc · method`

```pascal
procedure CkString_appendEnc(objHandle: HCkString;
    str: pbyte;
    charsetEncoding: pbyte) stdcall;
```

**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.appendInt

`Chilkat 11.7.0 · delphidll · CkString · appendInt · method`

```pascal
procedure CkString_appendInt(objHandle: HCkString;
    n: Integer) stdcall;
```

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

### CkString.appendN

`Chilkat 11.7.0 · delphidll · CkString · appendN · method`

```pascal
procedure CkString_appendN(objHandle: HCkString;
    str: pbyte;
    numBytes: LongWord) stdcall;
```

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 · delphidll · CkString · appendNU · method`

```pascal
procedure CkString_appendNU(objHandle: HCkString;
    wideStr: PWideChar;
    numChars: Integer) stdcall;
```

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 · delphidll · CkString · appendRandom · method`

```pascal
procedure CkString_appendRandom(objHandle: HCkString;
    numBytes: Integer;
    encoding: pbyte) stdcall;
```

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 · delphidll · CkString · appendStr · method`

```pascal
procedure CkString_appendStr(objHandle: HCkString;
    strObj: HCkString) stdcall;
```

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

### CkString.appendU

`Chilkat 11.7.0 · delphidll · CkString · appendU · method`

```pascal
procedure CkString_appendU(objHandle: HCkString;
    unicode: PWideChar) stdcall;
```

Append a Unicode string to the CkString object.

### CkString.appendUtf8

`Chilkat 11.7.0 · delphidll · CkString · appendUtf8 · method`

```pascal
procedure CkString_appendUtf8(objHandle: HCkString;
    str: pbyte) stdcall;
```

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 · delphidll · CkString · base64Decode · method`

```pascal
procedure CkString_base64Decode(objHandle: HCkString;
    charsetEncoding: pbyte) stdcall;
```

**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 · delphidll · CkString · base64DecodeW · method`

```pascal
procedure CkString_base64DecodeW(objHandle: HCkString;
    charsetEncoding: PWideChar) stdcall;
```

The utf-16 version of base64Decode.

### CkString.base64Encode

`Chilkat 11.7.0 · delphidll · CkString · base64Encode · method`

```pascal
procedure CkString_base64Encode(objHandle: HCkString;
    charsetEncoding: pbyte) stdcall;
```

**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 · delphidll · CkString · base64EncodeW · method`

```pascal
procedure CkString_base64EncodeW(objHandle: HCkString;
    charsetEncoding: PWideChar) stdcall;
```

The utf-16 version of base64Encode.

### CkString.beginsWith

`Chilkat 11.7.0 · delphidll · CkString · beginsWith · method`

```pascal
function CkString_beginsWith(objHandle: HCkString;
    substr: pbyte): wordbool; stdcall;
```

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

### CkString.beginsWithStr

`Chilkat 11.7.0 · delphidll · CkString · beginsWithStr · method`

```pascal
function CkString_beginsWithStr(objHandle: HCkString;
    strObj: HCkString): wordbool; stdcall;
```

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 · delphidll · CkString · beginsWithW · method`

```pascal
function CkString_beginsWithW(objHandle: HCkString;
    str: PWideChar): wordbool; stdcall;
```

The utf-16 version of beginsWith.

### CkString.charAt

`Chilkat 11.7.0 · delphidll · CkString · charAt · method`

```pascal
function CkString_charAt(objHandle: HCkString;
    idx: Integer): Char; stdcall;
```

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

### CkString.charAtU

`Chilkat 11.7.0 · delphidll · CkString · charAtU · method`

```pascal
function CkString_charAtU(objHandle: HCkString;
    idx: Integer): WideChar; stdcall;
```

Return the Nth character as a Unicode character.

### CkString.chopAtFirstChar

`Chilkat 11.7.0 · delphidll · CkString · chopAtFirstChar · method`

```pascal
procedure CkString_chopAtFirstChar(objHandle: HCkString;
    ch: Char) stdcall;
```

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

### CkString.chopAtStr

`Chilkat 11.7.0 · delphidll · CkString · chopAtStr · method`

```pascal
procedure CkString_chopAtStr(objHandle: HCkString;
    subStrObj: HCkString) stdcall;
```

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 · delphidll · CkString · clear · method`

```pascal
procedure CkString_clear(objHandle: HCkString) stdcall;
```

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

### CkString.clone

`Chilkat 11.7.0 · delphidll · CkString · clone · method`

```pascal
function CkString_clone(objHandle: HCkString): HCkString; stdcall;
```

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 `nil` on failure

### CkString.compareStr

`Chilkat 11.7.0 · delphidll · CkString · compareStr · method`

```pascal
function CkString_compareStr(objHandle: HCkString;
    str: HCkString): Integer; stdcall;
```

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 · delphidll · CkString · containsSubstring · method`

```pascal
function CkString_containsSubstring(objHandle: HCkString;
    substr: pbyte): wordbool; stdcall;
```

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

### CkString.containsSubstringNoCase

`Chilkat 11.7.0 · delphidll · CkString · containsSubstringNoCase · method`

```pascal
function CkString_containsSubstringNoCase(objHandle: HCkString;
    substr: pbyte): wordbool; stdcall;
```

Same as containsSubstring except the matching is case insensitive.

### CkString.containsSubstringNoCaseW

`Chilkat 11.7.0 · delphidll · CkString · containsSubstringNoCaseW · method`

```pascal
function CkString_containsSubstringNoCaseW(objHandle: HCkString;
    substr: PWideChar): wordbool; stdcall;
```

The utf-16 version of containsSubstringNoCase.

### CkString.containsSubstringW

`Chilkat 11.7.0 · delphidll · CkString · containsSubstringW · method`

```pascal
function CkString_containsSubstringW(objHandle: HCkString;
    substr: PWideChar): wordbool; stdcall;
```

The utf-16 version of containsSubstring.

### CkString.countCharOccurances

`Chilkat 11.7.0 · delphidll · CkString · countCharOccurances · method`

```pascal
function CkString_countCharOccurances(objHandle: HCkString;
    ch: Char): Integer; stdcall;
```

Returns the number of occurrences of the specified ANSI char.

### CkString.decodeXMLSpecial

`Chilkat 11.7.0 · delphidll · CkString · decodeXMLSpecial · method`

```pascal
procedure CkString_decodeXMLSpecial(objHandle: HCkString) stdcall;
```

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

### CkString.doubleValue

`Chilkat 11.7.0 · delphidll · CkString · doubleValue · method`

```pascal
function CkString_doubleValue(objHandle: HCkString): Double; stdcall;
```

Converts the string to a double and returns the value.

### CkString.eliminateChar

`Chilkat 11.7.0 · delphidll · CkString · eliminateChar · method`

```pascal
procedure CkString_eliminateChar(objHandle: HCkString;
    ansiChar: Char;
    startIndex: Integer) stdcall;
```

Eliminate all occurrences of a particular ANSI character.

### CkString.encodeXMLSpecial

`Chilkat 11.7.0 · delphidll · CkString · encodeXMLSpecial · method`

```pascal
procedure CkString_encodeXMLSpecial(objHandle: HCkString) stdcall;
```

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

### CkString.endsWith

`Chilkat 11.7.0 · delphidll · CkString · endsWith · method`

```pascal
function CkString_endsWith(objHandle: HCkString;
    substr: pbyte): wordbool; stdcall;
```

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

### CkString.endsWithStr

`Chilkat 11.7.0 · delphidll · CkString · endsWithStr · method`

```pascal
function CkString_endsWithStr(objHandle: HCkString;
    substrObj: HCkString): wordbool; stdcall;
```

Returns `True` if the string ends with the specified substring, otherwise returns `False`.

### CkString.endsWithW

`Chilkat 11.7.0 · delphidll · CkString · endsWithW · method`

```pascal
function CkString_endsWithW(objHandle: HCkString;
    s: PWideChar): wordbool; stdcall;
```

The utf-16 version of endsWith.

### CkString.entityDecode

`Chilkat 11.7.0 · delphidll · CkString · entityDecode · method`

```pascal
procedure CkString_entityDecode(objHandle: HCkString) stdcall;
```

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

### CkString.entityEncode

`Chilkat 11.7.0 · delphidll · CkString · entityEncode · method`

```pascal
procedure CkString_entityEncode(objHandle: HCkString) stdcall;
```

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

### CkString.equals

`Chilkat 11.7.0 · delphidll · CkString · equals · method`

```pascal
function CkString_equals(objHandle: HCkString;
    str: pbyte): wordbool; stdcall;
```

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

### CkString.equalsIgnoreCase

`Chilkat 11.7.0 · delphidll · CkString · equalsIgnoreCase · method`

```pascal
function CkString_equalsIgnoreCase(objHandle: HCkString;
    str: pbyte): wordbool; stdcall;
```

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

### CkString.equalsIgnoreCaseStr

`Chilkat 11.7.0 · delphidll · CkString · equalsIgnoreCaseStr · method`

```pascal
function CkString_equalsIgnoreCaseStr(objHandle: HCkString;
    strObj: HCkString): wordbool; stdcall;
```

Returns `True` if the strings are equal, otherwise returns `False` (case-insensitive)

### CkString.equalsIgnoreCaseW

`Chilkat 11.7.0 · delphidll · CkString · equalsIgnoreCaseW · method`

```pascal
function CkString_equalsIgnoreCaseW(objHandle: HCkString;
    s: PWideChar): wordbool; stdcall;
```

The utf-16 version of equalsIgnoreCase.

### CkString.equalsStr

`Chilkat 11.7.0 · delphidll · CkString · equalsStr · method`

```pascal
function CkString_equalsStr(objHandle: HCkString;
    strObj: HCkString): wordbool; stdcall;
```

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

### CkString.equalsW

`Chilkat 11.7.0 · delphidll · CkString · equalsW · method`

```pascal
function CkString_equalsW(objHandle: HCkString;
    s: PWideChar): wordbool; stdcall;
```

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

### CkString.getChar

`Chilkat 11.7.0 · delphidll · CkString · getChar · method`

```pascal
function CkString_getChar(objHandle: HCkString;
    idx: Integer): HCkString; stdcall;
```

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 `nil` on failure

### CkString.getEnc

`Chilkat 11.7.0 · delphidll · CkString · getEnc · method`

```pascal
function CkString_getEnc(objHandle: HCkString;
    encoding: pbyte): pbyte; stdcall;
```

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 · delphidll · CkString · getNumChars · method`

```pascal
function CkString_getNumChars(objHandle: HCkString): Integer; stdcall;
```

Returns the number of characters in the string.

### CkString.getSizeAnsi

`Chilkat 11.7.0 · delphidll · CkString · getSizeAnsi · method`

```pascal
function CkString_getSizeAnsi(objHandle: HCkString): Integer; stdcall;
```

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

### CkString.getSizeUnicode

`Chilkat 11.7.0 · delphidll · CkString · getSizeUnicode · method`

```pascal
function CkString_getSizeUnicode(objHandle: HCkString): Integer; stdcall;
```

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

### CkString.getSizeUtf8

`Chilkat 11.7.0 · delphidll · CkString · getSizeUtf8 · method`

```pascal
function CkString_getSizeUtf8(objHandle: HCkString): Integer; stdcall;
```

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

### CkString.getString

`Chilkat 11.7.0 · delphidll · CkString · getString · method`

```pascal
function CkString_getString(objHandle: HCkString): pbyte; stdcall;
```

Returns the contents of this instance.

### CkString.getStringAnsi

`Chilkat 11.7.0 · delphidll · CkString · getStringAnsi · method`

```pascal
function CkString_getStringAnsi(objHandle: HCkString): pbyte; stdcall;
```

Returns the string as null-terminated ANSI.

### CkString.getStringUtf8

`Chilkat 11.7.0 · delphidll · CkString · getStringUtf8 · method`

```pascal
function CkString_getStringUtf8(objHandle: HCkString): pbyte; stdcall;
```

Returns the string as null-terminated utf-8.

### CkString.getUnicode

`Chilkat 11.7.0 · delphidll · CkString · getUnicode · method`

```pascal
function CkString_getUnicode(objHandle: HCkString): PWideChar; stdcall;
```

Return a pointer to memory containing the string in Unicode.

### CkString.hexDecode

`Chilkat 11.7.0 · delphidll · CkString · hexDecode · method`

```pascal
procedure CkString_hexDecode(objHandle: HCkString;
    charsetEncoding: pbyte) stdcall;
```

**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 · delphidll · CkString · hexDecodeW · method`

```pascal
procedure CkString_hexDecodeW(objHandle: HCkString;
    charsetEncoding: PWideChar) stdcall;
```

The utf-16 version of hexDecode.

### CkString.hexEncode

`Chilkat 11.7.0 · delphidll · CkString · hexEncode · method`

```pascal
procedure CkString_hexEncode(objHandle: HCkString;
    charsetEncoding: pbyte) stdcall;
```

**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 · delphidll · CkString · hexEncodeW · method`

```pascal
procedure CkString_hexEncodeW(objHandle: HCkString;
    charsetEncoding: PWideChar) stdcall;
```

The utf-16 version of hexEncode.

### CkString.indexOf

`Chilkat 11.7.0 · delphidll · CkString · indexOf · method`

```pascal
function CkString_indexOf(objHandle: HCkString;
    substr: pbyte): Integer; stdcall;
```

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

### CkString.indexOfStr

`Chilkat 11.7.0 · delphidll · CkString · indexOfStr · method`

```pascal
function CkString_indexOfStr(objHandle: HCkString;
    substrObj: HCkString): Integer; stdcall;
```

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

### CkString.indexOfW

`Chilkat 11.7.0 · delphidll · CkString · indexOfW · method`

```pascal
function CkString_indexOfW(objHandle: HCkString;
    s: PWideChar): Integer; stdcall;
```

The utf-16 version of `indexOf`.

### CkString.intValue

`Chilkat 11.7.0 · delphidll · CkString · intValue · method`

```pascal
function CkString_intValue(objHandle: HCkString): Integer; stdcall;
```

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

### CkString.isEmpty

`Chilkat 11.7.0 · delphidll · CkString · isEmpty · method`

```pascal
function CkString_isEmpty(objHandle: HCkString): wordbool; stdcall;
```

Returns `True` if the string object is empty, otherwise returns `False`.

### CkString.lastChar

`Chilkat 11.7.0 · delphidll · CkString · lastChar · method`

```pascal
function CkString_lastChar(objHandle: HCkString): Char; stdcall;
```

Returns the last ANSI character in the string.

### CkString.loadFile

`Chilkat 11.7.0 · delphidll · CkString · loadFile · method`

```pascal
function CkString_loadFile(objHandle: HCkString;
    path: pbyte;
    charsetEncoding: pbyte): wordbool; stdcall;
```

**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 · delphidll · CkString · loadFileW · method`

```pascal
function CkString_loadFileW(objHandle: HCkString;
    path: PWideChar;
    charsetEncoding: PWideChar): wordbool; stdcall;
```

The utf-16 version of loadFile.

Returns True for success, False for failure.

### CkString.matches

`Chilkat 11.7.0 · delphidll · CkString · matches · method`

```pascal
function CkString_matches(objHandle: HCkString;
    strPattern: pbyte): wordbool; stdcall;
```

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 · delphidll · CkString · matchesNoCase · method`

```pascal
function CkString_matchesNoCase(objHandle: HCkString;
    strPattern: pbyte): wordbool; stdcall;
```

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 · delphidll · CkString · matchesNoCaseW · method`

```pascal
function CkString_matchesNoCaseW(objHandle: HCkString;
    s: PWideChar): wordbool; stdcall;
```

The utf-16 version of matchesNoCase.

### CkString.matchesStr

`Chilkat 11.7.0 · delphidll · CkString · matchesStr · method`

```pascal
function CkString_matchesStr(objHandle: HCkString;
    strPatternObj: HCkString): wordbool; stdcall;
```

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 · delphidll · CkString · matchesW · method`

```pascal
function CkString_matchesW(objHandle: HCkString;
    s: PWideChar): wordbool; stdcall;
```

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

### CkString.minimizeMemory

`Chilkat 11.7.0 · delphidll · CkString · minimizeMemory · method`

```pascal
procedure CkString_minimizeMemory(objHandle: HCkString) stdcall;
```

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 · delphidll · CkString · obfuscate · method`

```pascal
procedure CkString_obfuscate(objHandle: HCkString) stdcall;
```

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 · delphidll · CkString · prepend · method`

```pascal
procedure CkString_prepend(objHandle: HCkString;
    str: pbyte) stdcall;
```

Prepends `str` to this instance.

### CkString.prependW

`Chilkat 11.7.0 · delphidll · CkString · prependW · method`

```pascal
procedure CkString_prependW(objHandle: HCkString;
    s: PWideChar) stdcall;
```

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

### CkString.punyDecode

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

```pascal
procedure CkString_punyDecode(objHandle: HCkString) stdcall;
```

In-place decodes the string from punycode.

### CkString.punyEncode

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

```pascal
procedure CkString_punyEncode(objHandle: HCkString) stdcall;
```

In-place encodes the string to punycode.

### CkString.qpDecode

`Chilkat 11.7.0 · delphidll · CkString · qpDecode · method`

```pascal
procedure CkString_qpDecode(objHandle: HCkString;
    charsetEncoding: pbyte) stdcall;
```

**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 · delphidll · CkString · qpDecodeW · method`

```pascal
procedure CkString_qpDecodeW(objHandle: HCkString;
    charset: PWideChar) stdcall;
```

The utf-16 version of the qpDecode method.

### CkString.qpEncode

`Chilkat 11.7.0 · delphidll · CkString · qpEncode · method`

```pascal
procedure CkString_qpEncode(objHandle: HCkString;
    charsetEncoding: pbyte) stdcall;
```

**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 · delphidll · CkString · qpEncodeW · method`

```pascal
procedure CkString_qpEncodeW(objHandle: HCkString;
    charset: PWideChar) stdcall;
```

The utf-16 version of the qpEncode method.

### CkString.removeAll

`Chilkat 11.7.0 · delphidll · CkString · removeAll · method`

```pascal
function CkString_removeAll(objHandle: HCkString;
    substr: HCkString): Integer; stdcall;
```

Removes all occurrences of `substr`.

### CkString.removeCharOccurances

`Chilkat 11.7.0 · delphidll · CkString · removeCharOccurances · method`

```pascal
procedure CkString_removeCharOccurances(objHandle: HCkString;
    ch: Char) stdcall;
```

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

### CkString.removeChunk

`Chilkat 11.7.0 · delphidll · CkString · removeChunk · method`

```pascal
procedure CkString_removeChunk(objHandle: HCkString;
    charStartPos: Integer;
    numChars: Integer) stdcall;
```

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

### CkString.removeDelimited

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

```pascal
procedure CkString_removeDelimited(objHandle: HCkString;
    beginDelim: pbyte;
    endDelim: pbyte;
    caseSensitive: wordbool) stdcall;
```

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

### CkString.removeFirst

`Chilkat 11.7.0 · delphidll · CkString · removeFirst · method`

```pascal
function CkString_removeFirst(objHandle: HCkString;
    substr: HCkString): wordbool; stdcall;
```

Removes the first occurrence of a substring.

### CkString.replaceAll

`Chilkat 11.7.0 · delphidll · CkString · replaceAll · method`

```pascal
function CkString_replaceAll(objHandle: HCkString;
    findStrObj: HCkString;
    replaceStrObj: HCkString): Integer; stdcall;
```

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 · delphidll · CkString · replaceAllOccurances · method`

```pascal
function CkString_replaceAllOccurances(objHandle: HCkString;
    findStr: pbyte;
    replaceStr: pbyte): Integer; stdcall;
```

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 · delphidll · CkString · replaceAllOccurancesW · method`

```pascal
function CkString_replaceAllOccurancesW(objHandle: HCkString;
    pattern: PWideChar;
    replacement: PWideChar): Integer; stdcall;
```

The utf-16 version of the replaceAllOccurances method.

### CkString.replaceChar

`Chilkat 11.7.0 · delphidll · CkString · replaceChar · method`

```pascal
procedure CkString_replaceChar(objHandle: HCkString;
    findCh: Char;
    replaceCh: Char) stdcall;
```

Replaces all occurrences of a specified ANSI character with another.

### CkString.replaceFirst

`Chilkat 11.7.0 · delphidll · CkString · replaceFirst · method`

```pascal
function CkString_replaceFirst(objHandle: HCkString;
    findStrObj: HCkString;
    replaceStrObj: HCkString): wordbool; stdcall;
```

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 · delphidll · CkString · replaceFirstOccurance · method`

```pascal
function CkString_replaceFirstOccurance(objHandle: HCkString;
    findStr: pbyte;
    replaceStr: pbyte): wordbool; stdcall;
```

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 · delphidll · CkString · replaceFirstOccuranceW · method`

```pascal
function CkString_replaceFirstOccuranceW(objHandle: HCkString;
    pattern: PWideChar;
    replacement: PWideChar): wordbool; stdcall;
```

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 · delphidll · CkString · saveToFile · method`

```pascal
function CkString_saveToFile(objHandle: HCkString;
    path: pbyte;
    charsetEncoding: pbyte): wordbool; stdcall;
```

**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 · delphidll · CkString · saveToFileW · method`

```pascal
function CkString_saveToFileW(objHandle: HCkString;
    path: PWideChar;
    charset: PWideChar): wordbool; stdcall;
```

The utf-16 version of the saveToFile method.

Returns True for success, False for failure.

### CkString.setStr

`Chilkat 11.7.0 · delphidll · CkString · setStr · method`

```pascal
procedure CkString_setStr(objHandle: HCkString;
    s: HCkString) stdcall;
```

Replaces the contents of the string with another.

### CkString.setString

`Chilkat 11.7.0 · delphidll · CkString · setString · method`

```pascal
procedure CkString_setString(objHandle: HCkString;
    str: pbyte) stdcall;
```

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

### CkString.setStringAnsi

`Chilkat 11.7.0 · delphidll · CkString · setStringAnsi · method`

```pascal
procedure CkString_setStringAnsi(objHandle: HCkString;
    s: pbyte) stdcall;
```

Set the CkString object from an ANSI string.

### CkString.setStringU

`Chilkat 11.7.0 · delphidll · CkString · setStringU · method`

```pascal
procedure CkString_setStringU(objHandle: HCkString;
    unicode: PWideChar) stdcall;
```

Set the CkString object from a Unicode string.

### CkString.setStringUtf8

`Chilkat 11.7.0 · delphidll · CkString · setStringUtf8 · method`

```pascal
procedure CkString_setStringUtf8(objHandle: HCkString;
    s: pbyte) stdcall;
```

Set the string object from a utf-8 string.

### CkString.shorten

`Chilkat 11.7.0 · delphidll · CkString · shorten · method`

```pascal
procedure CkString_shorten(objHandle: HCkString;
    n: Integer) stdcall;
```

Discards the last N characters.

### CkString.split

`Chilkat 11.7.0 · delphidll · CkString · split · method`

```pascal
function CkString_split(objHandle: HCkString;
    delimiterChar: Char;
    exceptDoubleQuoted: wordbool;
    exceptEscaped: wordbool;
    keepEmpty: wordbool): HCkStringArray; stdcall;
```

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 `nil` on failure

### CkString.split2

`Chilkat 11.7.0 · delphidll · CkString · split2 · method`

```pascal
function CkString_split2(objHandle: HCkString;
    delimiterChars: pbyte;
    exceptDoubleQuoted: wordbool;
    exceptEscaped: wordbool;
    keepEmpty: wordbool): HCkStringArray; stdcall;
```

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

Returns `nil` on failure

### CkString.split2W

`Chilkat 11.7.0 · delphidll · CkString · split2W · method`

```pascal
function CkString_split2W(objHandle: HCkString;
    splitCharSet: PWideChar;
    exceptDoubleQuoted: wordbool;
    exceptEscaped: wordbool;
    keepEmpty: wordbool): HCkStringArray; stdcall;
```

The utf-16 version of the split2 method.

Returns `nil` on failure

### CkString.splitAtWS

`Chilkat 11.7.0 · delphidll · CkString · splitAtWS · method`

```pascal
function CkString_splitAtWS(objHandle: HCkString): HCkStringArray; stdcall;
```

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

Returns `nil` on failure

### CkString.substring

`Chilkat 11.7.0 · delphidll · CkString · substring · method`

```pascal
function CkString_substring(objHandle: HCkString;
    startCharIndex: Integer;
    numChars: Integer): HCkString; stdcall;
```

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

Returns `nil` on failure

### CkString.toCRLF

`Chilkat 11.7.0 · delphidll · CkString · toCRLF · method`

```pascal
procedure CkString_toCRLF(objHandle: HCkString) stdcall;
```

Converts all line endings to CRLF.

### CkString.tokenize

`Chilkat 11.7.0 · delphidll · CkString · tokenize · method`

```pascal
function CkString_tokenize(objHandle: HCkString;
    punctuation: pbyte): HCkStringArray; stdcall;
```

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 `nil` on failure

### CkString.tokenizeW

`Chilkat 11.7.0 · delphidll · CkString · tokenizeW · method`

```pascal
function CkString_tokenizeW(objHandle: HCkString;
    punctuation: PWideChar): HCkStringArray; stdcall;
```

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

Returns `nil` on failure

### CkString.toLF

`Chilkat 11.7.0 · delphidll · CkString · toLF · method`

```pascal
procedure CkString_toLF(objHandle: HCkString) stdcall;
```

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

### CkString.toLowerCase

`Chilkat 11.7.0 · delphidll · CkString · toLowerCase · method`

```pascal
procedure CkString_toLowerCase(objHandle: HCkString) stdcall;
```

Converts the string to lowercase.

### CkString.toUpperCase

`Chilkat 11.7.0 · delphidll · CkString · toUpperCase · method`

```pascal
procedure CkString_toUpperCase(objHandle: HCkString) stdcall;
```

Converts the string to uppercase.

### CkString.trim

`Chilkat 11.7.0 · delphidll · CkString · trim · method`

```pascal
procedure CkString_trim(objHandle: HCkString) stdcall;
```

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

### CkString.trim2

`Chilkat 11.7.0 · delphidll · CkString · trim2 · method`

```pascal
procedure CkString_trim2(objHandle: HCkString) stdcall;
```

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

### CkString.trimInsideSpaces

`Chilkat 11.7.0 · delphidll · CkString · trimInsideSpaces · method`

```pascal
procedure CkString_trimInsideSpaces(objHandle: HCkString) stdcall;
```

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 · delphidll · CkString · unobfuscate · method`

```pascal
procedure CkString_unobfuscate(objHandle: HCkString) stdcall;
```

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 · delphidll · CkString · urlDecode · method`

```pascal
procedure CkString_urlDecode(objHandle: HCkString;
    charsetEncoding: pbyte) stdcall;
```

**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 · delphidll · CkString · urlDecodeW · method`

```pascal
procedure CkString_urlDecodeW(objHandle: HCkString;
    charsetEncoding: PWideChar) stdcall;
```

The utf-16 version of the urlDecode method.

### CkString.urlEncode

`Chilkat 11.7.0 · delphidll · CkString · urlEncode · method`

```pascal
procedure CkString_urlEncode(objHandle: HCkString;
    charsetEncoding: pbyte) stdcall;
```

**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 · delphidll · CkString · urlEncodeW · method`

```pascal
procedure CkString_urlEncodeW(objHandle: HCkString;
    charsetEncoding: PWideChar) stdcall;
```

The utf-16 version of the urlEncode method.

## Related classes

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

