CkString ActiveX Reference
CkString
* This is a freeware class/component/library.
Object Creation
(Visual Basic 6.0)
Dim obj As New CkString
(ASP)
set obj = Server.CreateObject("Chilkat.String")
(VBScript)
set obj = CreateObject("Chilkat.String")
(Delphi)
obj := TCkString.Create(Self);
(FoxPro)
loObject = CreateObject('Chilkat.String')
(SQL Server)
EXEC @hr = sp_OACreate 'Chilkat.String', @obj OUT
(Javascript)
var obj = new ActiveXObject("Chilkat.String");
Properties
NumArabic As Long (read-only)
The number of Arabic characters contained in this string.
NumAscii As Long (read-only)
The number of us-ascii characters contained in this string.
NumCentralEuro As Long (read-only)
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.
NumChinese As Long (read-only)
The number of Chinese characters contained in this string.
NumCyrillic As Long (read-only)
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.
NumGreek As Long (read-only)
The number of Greek characters contained in this string.
NumHebrew As Long (read-only)
The number of Hebrew characters contained in this string.
NumJapanese As Long (read-only)
The number of Japanese characters contained in this string.
NumKorean As Long (read-only)
The number of Korean characters contained in this string.
NumLatin As Long (read-only)
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.
NumThai As Long (read-only)
The number of Thai characters contained in this string.
Str As String
The string value of this object.
Version As String (read-only)
The version of this component, such as "1.0.0"
Methods
AnsiCharAt(index As Long) As Long
Returns the ASCII value of the Nth char in the string. The 1st char is at index 0.
Append(inStr As String)
The inStr is appended to this string (the caller).
AppendDateRfc3339(dt As Date)
The Date (dt) is appended in RFC 3339 format to this string.
AppendDateRfc822(dt As Date)
The Date (dt) is appended in RFC 822 format to this string.
AppendEncoded(str As String, encoding As String, charset As String)
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")
AppendMultibyte(mbtext As Variant, charset As String)
Appends characters from a byte array. mbtext contains the character data. The input bytes are interpreted according to the character encoding specified by charset.
AppendToFile(filename As String, charset As String) As Long
Appends the contents of the string to a file. The string is first converted to the character encoding specified by charset before being appended to the file.
BeginsWith(substr As String) As Long
Returns 1 if the string begins with substr. Otherwise returns 0.
ChopAfter(findStr As String)
Truncates the string after the 1st occurance of findStr. If findStr is not present, nothing is truncated.
ChopBefore(findStr As String)
Truncates the string before the 1st occurance of findStr. If findStr is not present, nothing is truncated.
Clear()
Clears the string. After calling this method, the string has 0 characters.
Contains(substr As String) As Long
Returns 1 if substr is present in the string (case sensitive).
EmitMultibyte(charset As String) As Variant
Converts the string to a byte array using the character encoding specified by charset. Returns a zero-length byte array (as a Variant) on failure Demystifying ASP Code Pages, Response.Write, Response.BinaryWrite, Strings, and Charsets
EndsWith(subStr As String) As Long
Returns 1 if the string ends with subStr (case-sensitive). Otherwise returns 0.
GetEncoded(encoding As String, charset As String) As String
Returns the character string in an encoding use the charset specified. The encoding 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 a null on failure
HtmlEntityDecode()
Decodes any HTML entities found in the string. HTML Entity Decode ASP Example
HtmlEntityEncode()
HTML entity encodes all special characters. (Those characters that might require HTML entity encoding.) ASP HTML Entity Encode Example
LastAnsiChar() As Long
Returns the ASCII value of the last character in the string.
Left(numChars As Long) As String
Returns a string that is the leftmost numChars of the caller. Returns a null on failure
Length() As Long
Returns the length, in characters, of the string.
LoadFile(filename As String, charset As String) As Long
Loads an entire text file into the string object. The character encoding of the text file is specified by charset. This method allows for text files in any charset to be loaded: utf-8, Unicode, Shift_JIS, iso-8859-1, etc.
LoadXmlDoc(xmlDoc As Variant)
To be documented soon...
Matches(pattern As String, caseSensitive As Long) As Long
Returns 1 if the string matches the pattern, which may contain one or more asterisk wildcard characters. Case-sensitivity is controlled by , where 1 = case sensitive, 0 = case insensitive. ASP String Patttern Matching
Mid(idx As Long, numChars As Long) As String
Same as the VB/VBScript "Mid" function. Returns a substring of length numChars starting at idx, where the 1st char is at index 0. Returns a null on failure
ParseDateRfc3339() As Date
Converts the date string (in RFC 3339 format) to a Date type. Convert RFC 3339 Date to String and back
ParseDateRfc822() As Date
Converts the date string (in RFC 822 format) to a Date type. Convert RFC 822 Date to String and back
Pluralize()
Pluralizes an English word. Pluralize English Word
Prepend(inStr As String)
Prepends inStr to the string (i.e. to the caller).
RemoveAnsiChar(ch As Long)
Removes all occurances of ch from the string.
ReplaceAll(substr As String, replacement As String)
Replaces all occurances of substr with replacement. (case sensitive)
ReplaceAnsiChar(c1 As Long, c2 As Long)
Replaces all occurances of c1 with c2.
ReplaceFirst(substr As String, replacement As String)
Replaces the first occurance of substr with replacement. (case sensitive)
Right(numChars As Long) As String
Returns a string that is the rightmost numChars of the caller. Returns a null on failure
SaveToFile(filename As String, charset As String) As Long
Saves the string to a file, using the character encoding specified by charset. This method allows for the string to be saved using character encodings such as "utf-8", "Unicode", "Shift-JIS", or anything else...
Shorten(numChars As Long)
Removes the final numChars from the string.
StrComp(inStr As String, caseSensitive As Long) As Long
Lexicographically compares two strings. A zero return value indicates that 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 inStr; And a value less than zero indicates the opposite.
StripHtml()
Strips HTML tags from a string. Strip HTML from a String
Trim()
Trim SPACE and Tab characters from both ends of the string.
Trim2()
Trim SPACE, Tab, CR, and LF characters from both ends of the string.
TrimInside()
Replaces all tabs, CR's, and LF's, with SPACE chars, and removes extra SPACE's so there are no occurances of more than one SPACE char in a row. Trim Inside SPACE/TAB Characters
Unpluralize()
Unpluralizes an English word. Unpluralize English Word
|