---
product: Chilkat
product_version: 11.7.0
language: sqlserver
language_label: SQL Server
class: CkString
license: free
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/sqlserver_CkStringRef.html
---
# Chilkat CkString — SQL Server — v11.7.0

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

## Purpose

The Chilkat string class.

## Object creation, unlocking and error handling

**Object Creation**

```sql
DECLARE @hr int
DECLARE @ckString int
EXEC @hr = sp_OACreate 'Chilkat.CkString', @ckString OUT
IF @hr <> 0
BEGIN
    PRINT 'Failed to create ActiveX component'
    RETURN
END

-- ... use @ckString ...

EXEC @hr = sp_OADestroy @ckString
```

T-SQL uses the Chilkat ActiveX through the OLE Automation stored procedures. They must be enabled once on the server (`EXEC sp_configure 'Ole Automation Procedures', 1; RECONFIGURE;`), and the Chilkat ActiveX registered must match the bitness of the SQL Server instance (64-bit for a 64-bit SQL Server). To bind to a specific major version of Chilkat, append the major version number to the ProgID, such as `sp_OACreate 'Chilkat.CkString.11'` for Chilkat v11.\*.\*.

`sp_OACreate` returns an object token (an `int`) that is passed as the first argument of every `sp_OAMethod`, `sp_OAGetProperty` and `sp_OASetProperty` call, and released with `sp_OADestroy`. Objects returned by methods (such as an `HttpResponse` or `JsonObject`) are also tokens received through an `int` OUT parameter; they must likewise be destroyed, and the OUT parameter is `NULL` when the method fails to return an object. Objects passed as arguments are passed by their token. When an OLE Automation procedure itself fails (non-zero `@hr`), `sp_OAGetErrorInfo` describes the error.

Data types: strings are `nvarchar(4000)`; integers, booleans (1 or 0) and object tokens are `int`; dates are `datetime`. In the signatures on this page, `@success`, `@iResult`, `@sResult` and the like are the OUT variables receiving a method's return value, `@iValue` / `@sValue` receive or supply a property value, and the remaining `@` variables are the method's arguments in order.

A string returned through an OUT parameter is limited to 4000 characters. For longer values, retrieve the result as a result set into a table variable instead of an OUT parameter, for example `DECLARE @tmp TABLE (outputLine ntext)` followed by `INSERT INTO @tmp EXEC sp_OAGetProperty @ckString, 'LastErrorText'`. See [string length limitations for strings returned by sp_OAMethod calls](https://www.chilkatsoft.com/sql_server_nvarchar_max_limitation.asp).

Methods that pass or return raw byte arrays are not shown on this page, because `varbinary(max)` values cannot be exchanged through `sp_OAMethod` (see [varbinary(max) limitation](https://www.chilkatsoft.com/sql_server_varbinary_max_limitation.asp)). Use the `BinData`-based alternatives (methods ending in *Bd*) or the base64 / hex string-encoded variants instead. Binary *properties* (such as `LastBinaryResult`) can be retrieved as a result set into a table variable, as shown in their signatures. Asynchronous (*\*Async*) methods and event callbacks are not available from SQL Server.

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 SQL Server.

How failure is reported depends on the method's return type and is stated in the note under each method below. In every case the diagnostic text is in the `LastErrorText` property of the object whose method was called.

## Member index

| Member | Kind | Signature |
|---|---|---|
| `NumArabic` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'NumArabic', @iValue OUT` |
| `NumAscii` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'NumAscii', @iValue OUT` |
| `NumCentralEuro` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'NumCentralEuro', @iValue OUT` |
| `NumChars` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'NumChars', @iValue OUT` |
| `NumChinese` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'NumChinese', @iValue OUT` |
| `NumCyrillic` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'NumCyrillic', @iValue OUT` |
| `NumGreek` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'NumGreek', @iValue OUT` |
| `NumHebrew` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'NumHebrew', @iValue OUT` |
| `NumJapanese` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'NumJapanese', @iValue OUT` |
| `NumKorean` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'NumKorean', @iValue OUT` |
| `NumLatin` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'NumLatin', @iValue OUT` |
| `NumThai` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'NumThai', @iValue OUT` |
| `SizeAnsi` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'SizeAnsi', @iValue OUT` |
| `SizeUtf8` | property, read-only | `EXEC sp_OAGetProperty @ckString, 'SizeUtf8', @iValue OUT` |
| `Str` | property, read/write | `EXEC sp_OAGetProperty @ckString, 'Str', @sValue OUT EXEC sp_OASetProperty @ckString, 'Str', @sValue` |
| `AnsiCharAt` | method | `EXEC sp_OAMethod @ckString, 'AnsiCharAt', @iResult OUT, @index` |
| `Append` | method | `EXEC sp_OAMethod @ckString, 'Append', NULL, @str` |
| `AppendDateRfc3339` | method | `EXEC sp_OAMethod @ckString, 'AppendDateRfc3339', NULL, @dt` |
| `AppendDateRfc822` | method | `EXEC sp_OAMethod @ckString, 'AppendDateRfc822', NULL, @dt` |
| `AppendEncoded` | method | `EXEC sp_OAMethod @ckString, 'AppendEncoded', NULL, @str, @encoding, @charset` |
| `AppendToFile` | method | `EXEC sp_OAMethod @ckString, 'AppendToFile', @success OUT, @path, @charsetEncoding` |
| `BeginsWith` | method | `EXEC sp_OAMethod @ckString, 'BeginsWith', @success OUT, @str` |
| `ChopAfter` | method | `EXEC sp_OAMethod @ckString, 'ChopAfter', NULL, @findStr` |
| `ChopBefore` | method | `EXEC sp_OAMethod @ckString, 'ChopBefore', NULL, @findStr` |
| `Clear` | method | `EXEC sp_OAMethod @ckString, 'Clear', NULL` |
| `Contains` | method | `EXEC sp_OAMethod @ckString, 'Contains', @success OUT, @substr` |
| `EndsWith` | method | `EXEC sp_OAMethod @ckString, 'EndsWith', @success OUT, @substr` |
| `GetEncoded` | method | `EXEC sp_OAMethod @ckString, 'GetEncoded', @sResult OUT, @binaryEncoding, @charsetEncoding` |
| `HtmlEntityDecode` | method | `EXEC sp_OAMethod @ckString, 'HtmlEntityDecode', NULL` |
| `HtmlEntityEncode` | method | `EXEC sp_OAMethod @ckString, 'HtmlEntityEncode', NULL` |
| `LastAnsiChar` | method | `EXEC sp_OAMethod @ckString, 'LastAnsiChar', @iResult OUT` |
| `Left` | method | `EXEC sp_OAMethod @ckString, 'Left', @sResult OUT, @numChars` |
| `Length` | method | `EXEC sp_OAMethod @ckString, 'Length', @iResult OUT` |
| `LoadFile` | method | `EXEC sp_OAMethod @ckString, 'LoadFile', @success OUT, @path, @charsetEncoding` |
| `Matches` | method | `EXEC sp_OAMethod @ckString, 'Matches', @success OUT, @strPattern, @caseSensitive` |
| `Mid` | method | `EXEC sp_OAMethod @ckString, 'Mid', @sResult OUT, @index, @numChars` |
| `ParseDateRfc3339` | method | `EXEC sp_OAMethod @ckString, 'ParseDateRfc3339', @dtResult OUT` |
| `ParseDateRfc822` | method | `EXEC sp_OAMethod @ckString, 'ParseDateRfc822', @dtResult OUT` |
| `Pluralize` | method | `EXEC sp_OAMethod @ckString, 'Pluralize', NULL` |
| `Prepend` | method | `EXEC sp_OAMethod @ckString, 'Prepend', NULL, @str` |
| `PunyDecode` | method | `EXEC sp_OAMethod @ckString, 'PunyDecode', NULL` |
| `PunyEncode` | method | `EXEC sp_OAMethod @ckString, 'PunyEncode', NULL` |
| `RemoveAnsiChar` | method | `EXEC sp_OAMethod @ckString, 'RemoveAnsiChar', NULL, @ch` |
| `ReplaceAll` | method | `EXEC sp_OAMethod @ckString, 'ReplaceAll', NULL, @findStr, @replaceStr` |
| `ReplaceAnsiChar` | method | `EXEC sp_OAMethod @ckString, 'ReplaceAnsiChar', NULL, @findCh, @replaceCh` |
| `ReplaceFirst` | method | `EXEC sp_OAMethod @ckString, 'ReplaceFirst', NULL, @findStr, @replaceStr` |
| `Right` | method | `EXEC sp_OAMethod @ckString, 'Right', @sResult OUT, @numChars` |
| `SaveToFile` | method | `EXEC sp_OAMethod @ckString, 'SaveToFile', @success OUT, @path, @charsetEncoding` |
| `Shorten` | method | `EXEC sp_OAMethod @ckString, 'Shorten', NULL, @numChars` |
| `StrComp` | method | `EXEC sp_OAMethod @ckString, 'StrComp', @iResult OUT, @str, @caseSensitive` |
| `StripHtml` | method | `EXEC sp_OAMethod @ckString, 'StripHtml', NULL` |
| `ToCRLF` | method | `EXEC sp_OAMethod @ckString, 'ToCRLF', NULL` |
| `ToLF` | method | `EXEC sp_OAMethod @ckString, 'ToLF', NULL` |
| `Trim` | method | `EXEC sp_OAMethod @ckString, 'Trim', NULL` |
| `Trim2` | method | `EXEC sp_OAMethod @ckString, 'Trim2', NULL` |
| `TrimInside` | method | `EXEC sp_OAMethod @ckString, 'TrimInside', NULL` |
| `Unpluralize` | method | `EXEC sp_OAMethod @ckString, 'Unpluralize', NULL` |

## Properties

### CkString.NumArabic

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

```sql
EXEC sp_OAGetProperty @ckString, 'NumArabic', @iValue OUT
```

The number of Arabic characters contained in this string.

### CkString.NumAscii

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

```sql
EXEC sp_OAGetProperty @ckString, 'NumAscii', @iValue OUT
```

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

### CkString.NumCentralEuro

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

```sql
EXEC sp_OAGetProperty @ckString, 'NumCentralEuro', @iValue OUT
```

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.NumChars

`Chilkat 11.7.0 · sqlserver · CkString · NumChars · property · read-only`

```sql
EXEC sp_OAGetProperty @ckString, 'NumChars', @iValue OUT
```

The number of characters in the string.

### CkString.NumChinese

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

```sql
EXEC sp_OAGetProperty @ckString, 'NumChinese', @iValue OUT
```

The number of Chinese characters contained in this string.

### CkString.NumCyrillic

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

```sql
EXEC sp_OAGetProperty @ckString, 'NumCyrillic', @iValue OUT
```

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

```sql
EXEC sp_OAGetProperty @ckString, 'NumGreek', @iValue OUT
```

The number of Greek characters contained in this string.

### CkString.NumHebrew

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

```sql
EXEC sp_OAGetProperty @ckString, 'NumHebrew', @iValue OUT
```

The number of Hebrew characters contained in this string.

### CkString.NumJapanese

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

```sql
EXEC sp_OAGetProperty @ckString, 'NumJapanese', @iValue OUT
```

The number of Japanese characters contained in this string.

### CkString.NumKorean

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

```sql
EXEC sp_OAGetProperty @ckString, 'NumKorean', @iValue OUT
```

The number of Korean characters contained in this string.

### CkString.NumLatin

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

```sql
EXEC sp_OAGetProperty @ckString, 'NumLatin', @iValue OUT
```

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

```sql
EXEC sp_OAGetProperty @ckString, 'NumThai', @iValue OUT
```

The number of Thai characters contained in this string.

### CkString.SizeAnsi

`Chilkat 11.7.0 · sqlserver · CkString · SizeAnsi · property · read-only`

```sql
EXEC sp_OAGetProperty @ckString, 'SizeAnsi', @iValue OUT
```

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

### CkString.SizeUtf8

`Chilkat 11.7.0 · sqlserver · CkString · SizeUtf8 · property · read-only`

```sql
EXEC sp_OAGetProperty @ckString, 'SizeUtf8', @iValue OUT
```

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

### CkString.Str

`Chilkat 11.7.0 · sqlserver · CkString · Str · property · read/write`

```sql
EXEC sp_OAGetProperty @ckString, 'Str', @sValue OUT
EXEC sp_OASetProperty @ckString, 'Str', @sValue
```

The string value of this object.

## Methods

### CkString.AnsiCharAt

`Chilkat 11.7.0 · sqlserver · CkString · AnsiCharAt · method`

```sql
EXEC sp_OAMethod @ckString, 'AnsiCharAt', @iResult OUT, @index
```

Returns the ASCII value of the Nth char in the string. The 1st char is at index 0.

### CkString.Append

`Chilkat 11.7.0 · sqlserver · CkString · Append · method`

```sql
EXEC sp_OAMethod @ckString, 'Append', NULL, @str
```

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

### CkString.AppendDateRfc3339

`Chilkat 11.7.0 · sqlserver · CkString · AppendDateRfc3339 · method`

```sql
EXEC sp_OAMethod @ckString, 'AppendDateRfc3339', NULL, @dt
```

Appends a date/time string in RFC 3339 format to the end of this instance.

### CkString.AppendDateRfc822

`Chilkat 11.7.0 · sqlserver · CkString · AppendDateRfc822 · method`

```sql
EXEC sp_OAMethod @ckString, 'AppendDateRfc822', NULL, @dt
```

The `dt` is appended in RFC 822 format to the end of this instance.

### CkString.AppendEncoded

`Chilkat 11.7.0 · sqlserver · CkString · AppendEncoded · method`

```sql
EXEC sp_OAMethod @ckString, 'AppendEncoded', NULL, @str, @encoding, @charset
```

**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 characters from an encoded string. The encoding may be `base64`, `hex`, `url`, or `quoted-printable`. For example, to append `ABC 123` from a URL-encoded string, call:

```
strObj.AppendEncoded(ABC+123,url,iso-8859-1)
```

### CkString.AppendToFile

`Chilkat 11.7.0 · sqlserver · CkString · AppendToFile · method`

```sql
EXEC sp_OAMethod @ckString, 'AppendToFile', @success OUT, @path, @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 the contents of the string to a file. The string is first converted to the character encoding specified by `charsetEncoding` before being appended to the file.

### CkString.BeginsWith

`Chilkat 11.7.0 · sqlserver · CkString · BeginsWith · method`

```sql
EXEC sp_OAMethod @ckString, 'BeginsWith', @success OUT, @str
```

Returns `1` if the string begins with `str`. Otherwise returns `0`. This method is case sensitive.

### CkString.ChopAfter

`Chilkat 11.7.0 · sqlserver · CkString · ChopAfter · method`

```sql
EXEC sp_OAMethod @ckString, 'ChopAfter', NULL, @findStr
```

Truncates the string after the 1st occurrence of `findStr`. If `findStr` is not present, nothing is truncated.

### CkString.ChopBefore

`Chilkat 11.7.0 · sqlserver · CkString · ChopBefore · method`

```sql
EXEC sp_OAMethod @ckString, 'ChopBefore', NULL, @findStr
```

Truncates the string before the 1st occurrence of `findStr`. If `findStr` is not present, nothing is truncated.

### CkString.Clear

`Chilkat 11.7.0 · sqlserver · CkString · Clear · method`

```sql
EXEC sp_OAMethod @ckString, 'Clear', NULL
```

Clears the string. After calling this method, the string contains 0 characters.

### CkString.Contains

`Chilkat 11.7.0 · sqlserver · CkString · Contains · method`

```sql
EXEC sp_OAMethod @ckString, 'Contains', @success OUT, @substr
```

Returns `1` if `substr` is present in the string (case sensitive), otherwise returns `0`.

### CkString.EndsWith

`Chilkat 11.7.0 · sqlserver · CkString · EndsWith · method`

```sql
EXEC sp_OAMethod @ckString, 'EndsWith', @success OUT, @substr
```

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

### CkString.GetEncoded

`Chilkat 11.7.0 · sqlserver · CkString · GetEncoded · method`

```sql
EXEC sp_OAMethod @ckString, 'GetEncoded', @sResult OUT, @binaryEncoding, @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)

Returns the character string in an encoding use the `charsetEncoding` specified. The `binaryEncoding` may be `base64`, `hex`, `url`, or `quoted-printable`. For example:

```
(Visual Basic 6.0)

Dim s As New CkString

s.Str = Ã¨Ã¨Ã¨
Text1.Text = s.GetEncoded(hex, iso-8859-1) & vbCrLf
Text1.Text = Text.Text & s.GetEncoded(hex, utf-8) & vbCrLf
Text1.Text = Text1.Text & s.GetEncoded(hex, unicode)

'Output:
'E8E8E8
'C3A8C3A8C3A8
'E800E800E800
```

Returns `NULL` on failure

### CkString.HtmlEntityDecode

`Chilkat 11.7.0 · sqlserver · CkString · HtmlEntityDecode · method`

```sql
EXEC sp_OAMethod @ckString, 'HtmlEntityDecode', NULL
```

Decodes any HTML entities found in the string.

### CkString.HtmlEntityEncode

`Chilkat 11.7.0 · sqlserver · CkString · HtmlEntityEncode · method`

```sql
EXEC sp_OAMethod @ckString, 'HtmlEntityEncode', NULL
```

HTML entity encodes all special characters. (Those characters that might require HTML entity encoding.)

### CkString.LastAnsiChar

`Chilkat 11.7.0 · sqlserver · CkString · LastAnsiChar · method`

```sql
EXEC sp_OAMethod @ckString, 'LastAnsiChar', @iResult OUT
```

Returns the ASCII value of the last character in the string.

### CkString.Left

`Chilkat 11.7.0 · sqlserver · CkString · Left · method`

```sql
EXEC sp_OAMethod @ckString, 'Left', @sResult OUT, @numChars
```

Returns a string that is the leftmost `numChars` of this instance.

Returns `NULL` on failure

### CkString.Length

`Chilkat 11.7.0 · sqlserver · CkString · Length · method`

```sql
EXEC sp_OAMethod @ckString, 'Length', @iResult OUT
```

Returns the length, in characters, of the string.

### CkString.LoadFile

`Chilkat 11.7.0 · sqlserver · CkString · LoadFile · method`

```sql
EXEC sp_OAMethod @ckString, 'LoadFile', @success OUT, @path, @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)

Loads an entire text file into the string object. 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.

### CkString.Matches

`Chilkat 11.7.0 · sqlserver · CkString · Matches · method`

```sql
EXEC sp_OAMethod @ckString, 'Matches', @success OUT, @strPattern, @caseSensitive
```

Returns `1` if the string matches the `strPattern`, which may contain one or more asterisk wildcard characters. Case-sensitivity is controlled by , where 1 = case sensitive, 0 = case insensitive.

### CkString.Mid

`Chilkat 11.7.0 · sqlserver · CkString · Mid · method`

```sql
EXEC sp_OAMethod @ckString, 'Mid', @sResult OUT, @index, @numChars
```

Same as the VB/VBScript `Mid` function, except that the 1st char is at index 0 (i.e. it is not 1-based). Returns a substring of length `numChars` starting at `index`.

Returns `NULL` on failure

### CkString.ParseDateRfc3339

`Chilkat 11.7.0 · sqlserver · CkString · ParseDateRfc3339 · method`

```sql
EXEC sp_OAMethod @ckString, 'ParseDateRfc3339', @dtResult OUT
```

Converts the date string (in RFC 3339 format) to a Date type.

### CkString.ParseDateRfc822

`Chilkat 11.7.0 · sqlserver · CkString · ParseDateRfc822 · method`

```sql
EXEC sp_OAMethod @ckString, 'ParseDateRfc822', @dtResult OUT
```

Converts the date string (in RFC 822 format) to a Date type.

### CkString.Pluralize

`Chilkat 11.7.0 · sqlserver · CkString · Pluralize · method`

```sql
EXEC sp_OAMethod @ckString, 'Pluralize', NULL
```

Pluralizes an English word.

### CkString.Prepend

`Chilkat 11.7.0 · sqlserver · CkString · Prepend · method`

```sql
EXEC sp_OAMethod @ckString, 'Prepend', NULL, @str
```

Prepends `str` to this instance.

### CkString.PunyDecode

`Chilkat 11.7.0 · sqlserver · CkString · PunyDecode · method · since 9.5.0.52`

```sql
EXEC sp_OAMethod @ckString, 'PunyDecode', NULL
```

In-place decodes the string from punycode.

### CkString.PunyEncode

`Chilkat 11.7.0 · sqlserver · CkString · PunyEncode · method · since 9.5.0.52`

```sql
EXEC sp_OAMethod @ckString, 'PunyEncode', NULL
```

In-place encodes the string to punycode.

### CkString.RemoveAnsiChar

`Chilkat 11.7.0 · sqlserver · CkString · RemoveAnsiChar · method`

```sql
EXEC sp_OAMethod @ckString, 'RemoveAnsiChar', NULL, @ch
```

Removes all occurrences of `ch` from the string.

### CkString.ReplaceAll

`Chilkat 11.7.0 · sqlserver · CkString · ReplaceAll · method`

```sql
EXEC sp_OAMethod @ckString, 'ReplaceAll', NULL, @findStr, @replaceStr
```

Replaces all occurrences of `findStr` with `replaceStr`. (case sensitive)

### CkString.ReplaceAnsiChar

`Chilkat 11.7.0 · sqlserver · CkString · ReplaceAnsiChar · method`

```sql
EXEC sp_OAMethod @ckString, 'ReplaceAnsiChar', NULL, @findCh, @replaceCh
```

Replaces all occurrences of `findCh` with `replaceCh`.

### CkString.ReplaceFirst

`Chilkat 11.7.0 · sqlserver · CkString · ReplaceFirst · method`

```sql
EXEC sp_OAMethod @ckString, 'ReplaceFirst', NULL, @findStr, @replaceStr
```

Replaces the first occurrence of `findStr` with `replaceStr`. (case sensitive)

### CkString.Right

`Chilkat 11.7.0 · sqlserver · CkString · Right · method`

```sql
EXEC sp_OAMethod @ckString, 'Right', @sResult OUT, @numChars
```

Returns a string that is the rightmost `numChars` of this instance.

Returns `NULL` on failure

### CkString.SaveToFile

`Chilkat 11.7.0 · sqlserver · CkString · SaveToFile · method`

```sql
EXEC sp_OAMethod @ckString, 'SaveToFile', @success OUT, @path, @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`. This method allows for the string to be saved using character encodings such as `utf-8`, `Unicode`, `Shift-JIS`, or anything else...

Returns 1 for success, 0 for failure.

### CkString.Shorten

`Chilkat 11.7.0 · sqlserver · CkString · Shorten · method`

```sql
EXEC sp_OAMethod @ckString, 'Shorten', NULL, @numChars
```

Removes the final `numChars` from the string.

### CkString.StrComp

`Chilkat 11.7.0 · sqlserver · CkString · StrComp · method`

```sql
EXEC sp_OAMethod @ckString, 'StrComp', @iResult OUT, @str, @caseSensitive
```

Lexicographically compares two strings. Returns 0 if both strings are equal. A value greater than zero indicates that the first character that does not match has a greater value in the caller's string than in `str`; And a value less than zero indicates the opposite.

### CkString.StripHtml

`Chilkat 11.7.0 · sqlserver · CkString · StripHtml · method`

```sql
EXEC sp_OAMethod @ckString, 'StripHtml', NULL
```

Strips HTML tags from a string.

### CkString.ToCRLF

`Chilkat 11.7.0 · sqlserver · CkString · ToCRLF · method`

```sql
EXEC sp_OAMethod @ckString, 'ToCRLF', NULL
```

Converts all line endings to CRLF.

### CkString.ToLF

`Chilkat 11.7.0 · sqlserver · CkString · ToLF · method`

```sql
EXEC sp_OAMethod @ckString, 'ToLF', NULL
```

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

### CkString.Trim

`Chilkat 11.7.0 · sqlserver · CkString · Trim · method`

```sql
EXEC sp_OAMethod @ckString, 'Trim', NULL
```

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

### CkString.Trim2

`Chilkat 11.7.0 · sqlserver · CkString · Trim2 · method`

```sql
EXEC sp_OAMethod @ckString, 'Trim2', NULL
```

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

### CkString.TrimInside

`Chilkat 11.7.0 · sqlserver · CkString · TrimInside · method`

```sql
EXEC sp_OAMethod @ckString, 'TrimInside', NULL
```

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.Unpluralize

`Chilkat 11.7.0 · sqlserver · CkString · Unpluralize · method`

```sql
EXEC sp_OAMethod @ckString, 'Unpluralize', NULL
```

Unpluralizes an English word.

