String Manipulations Class

Entisoft Tools 2.0 Object Library
Version 2.1 Build 208
<-- Previous || Index || Main || Topics || Next -->

Declarations Section, Cat Sub, CatLine Sub, CharacterEveryNthCharacter Function, CharacterEveryNthCharacterSample Sub, CompareStrings Function, CompressSpaces Function, ContrastStrings Function, DeleteString Function, DifferenceString Function, DoubleQuoteString Function, GrepToLike Function, HashString Function, HashStringFast Function, InsertString Function, MergeStrings Function, MidReverse Function, MidString Function, OverlayString Function, QuoteString Function, RepeatString Function, RepeatStringCharacters Function, RepeatStringToLength Function, ReverseEveryNCharacters Function, ReverseString Function, RotateString Function, RotateStringLeft Function, RotateStringRight Function, SeparateCharactersIntoNGroups Function, ShiftStringLeft Function, ShiftStringRight Function, SplitStrings Function, SplitStringsSample Sub, StrDel Sub, StringEveryNthCharacter Function, StringEveryNthCharacterSample Sub, StringEveryNthCharRepeated Function, StringPastMinLength Function, StringRotateLeft Function, StringRotateRight Function, StringShiftLeft Function, StringShiftRight Function, StrIns Sub, StripDoubleQuotes Function, StripLeftNCharacters Function, StripRightNCharacters Function, SwapCharacters Function, TruncateLeftWithEllipse Function, TruncateRightWithEllipse Function

Declarations Section
 
Cat Sub
"Concatenate" Concatenate the string representation of a value onto the end of a string.
Cat Line Sub
"Concatenate Line" Add a line of text onto the end of a string representing a paragraph. Concatenate the string representation of a value onto the end of a string, preceded by carriage return and new line characters unless the target string rTo is empty.
Character Every Nth Character Function
Extracts characters from a string by stepping through it vStep positions at a time. Stops when the beginning or end of the source string vString is reached. Inverse of the MergeStrings function.
Character Every Nth Character Sample Sub
Sample calls to the CharacterEveryNthCharacter function.
Compare Strings Function
Indicate which portions of two strings are the same. Includes the original strings and the marker string all separated by carriage return and line feed characters. Indicates matches with a caret character ("^") in the marker string and indicates differences with a space (" ").
Compress Spaces Function
Compresses all whitespace down to a single space character. Replaces all repeated runs of space-type characters (space, tab, carriage return, etc.) with a single space character. Uses the IsSpace function with the currently-loaded character classifications to determine which characters are considered "space".
Contrast Strings Function
Indicate which portions of two strings are the same. Includes the original strings and the marker string all separated by carriage return and line feed characters. Indicates differences with a caret character ("^") in the marker string and indicates matches with a space (" ").
Delete String Function
Returns the string vString with a portion of the string removed. Removes the portion of vString beginning at character position vStartPos with a length of vLength.
Difference String Function
Returns a string with different characters describing the matching and non-matching portions of the two strings. The character at a specific position within the returned string describes whether characters at the same corresponding positions within vStringOne and vStringTwo match each other.
Double Quote String Function
Surrounds a string with double-quote characters ("). Replaces each double-quote character within the string with two double-quote characters.
Grep To Like Function
"UNIX grep To Visual Basic LIKE" Fixes up some limited forms of wildcards from one style (UNIX) to another (Microsoft). Accepts a wildcard that is more like those recognized by UNIX and returns the corresponding wildcard/pattern recognized by the Microsoft's LIKE operator.
Hash String Function
Return a hash value for the specified string. Converts a string into a numeric identifier that is likely unique, given an appropriate value for vRangePrimeNumber. The number returned will be between 0 (zero) and vRangePrimeNumber - 1.
Hash String Fast Function
Return a hash value for the specified string. Converts a string into a numeric identifier that is likely unique, given an appropriate value for vRangePrimeNumber. "Fast" version of the HashString function which has restrictive argument types. See the HashString function for details.
Insert String Function
Insert one string into the middle of another string and return the results. vSource is inserted into vDest before character position vInsertPosition.
Merge Strings Function
Creates a string by interspersing the characters from the two input strings. Inverse of the SplitStrings and CharacterEveryNthCharacter functions.
Mid Reverse Function
"Middle String Reverse" Similar to the Visual Basic Mid function, except that the returned string is constructed by moving backwards through vString instead of forwards.
Mid String Function
"Middle String" Like the Visual Basic Mid function, except that the vStart can be negative.
Overlay String Function
Overlays the string vFm on top of string vTo at an offset of vOffset. Any portion of vFm which, when overlaid onto vTo at an offset of vOffset, would be before the beginning of vTo or past its end is ignored/truncated.
Quote String Function
Surrounds a string with some "quote" character. Replaces each "quote" character within the string with two "quote" characters.
Repeat String Function
Like the Visual Basic String$() function, except all of the characters in the string are repeated instead of only the first character within the string.
Repeat String Characters Function
Creates a string by repeating each of the characters in vStringChars. Each character within vStringChars is repeated the specified number of times before the succeeding character is repeated.
Repeat String To Length Function
Like the built-in String$() function, except all of the characters in the string are repeated until string is of length vLength.
Reverse Every N Characters Function
Reverse the characters within every set of characters of length vSize.
Reverse String Function
Reverse the characters within a string. "ABCDEF" becomes "FEDCBA", etc.
Rotate String Function
Rotates the characters within a string after some specified character position.
Rotate String Left Function
Rotates the characters within a string to the left by vPositions, taking the first vPositions characters within the string and placing them at the end of the string.
Rotate String Right Function
Rotates the characters within a string to the right by vPositions, taking the last vPositions characters within the string and placing them at the beginning of the string.
Separate Characters Into N Groups Function
Forms the characters of vString into separate groups (lines, words, etc.), with the 1st character going into the 1st position in line #1, the 2nd character going into the 1st position in line #2, the 3rd character going into the 2nd position in line #1, etc. Similar to the StringEveryNthCharRepeated function.
Shift String Left Function
Shifts the characters within a string to the left by vPositions. Same as removing the first vPositions characters from vValue.
Shift String Right Function
Shifts the characters within a string to the right by vPositions. Same as removing the last vPositions characters from vValue.
Split Strings Function
Takes the characters in odd-numbered positions within string vValue and places them within rOddPosChars and takes the characters in even-numbered positions within vValue and places then within rEvenPosChars.
Split Strings Sample Sub
Sample of the SplitStrings function.
Str Del Sub
"String Delete" Remove some number of characters from a string starting at a specific position and going forward.
String Every Nth Character Function
Steps forward through vString creating a string from all of the sub-strings of length vLength. Starts at character position vStep. If vTruncate is True, then the final sub-string will be truncated unless it is of length vLength.
String Every Nth Character Sample Sub
Sample calls to the StringEveryNthCharacter function.
String Every Nth Char Repeated Function
"String Every Nth Character Repeated" Creates the string resulting from taking the character at position 1 (one) and at every Nth succeeding position (where N = vStep), then by repeating this process until the start position is equal to the vStep.
String Past Min Length Function
"String Past Minimum Length" Returns the part of the longer string that is beyond the length of the smaller string. If the lengths of the strings match, then return an empty string.
String Rotate Left Function
Rotates the characters within a string one position to the left, with the character at the beginning of the string being added onto the end of the string. Returns the ASCII value of the character at the beginning of string rValue. (The character at the beginning of the string before the characters are rotated).
String Rotate Right Function
Rotates the characters within a string one position to the right, with the character at the end of the string being added onto the beginning of the string. Returns the ASCII value of the character at the end of string rValue. (The character at the end of the string before the characters are rotated).
String Shift Left Function
Shifts the characters within a string one position to the left, with the character at the beginning of the string being removed. Returns the ASCII value of the character at the beginning of string rValue. (The character at the beginning of the string before the characters are shifted).
String Shift Right Function
Shifts the characters within a string one position to the right, with the character at the end of the string being removed. Returns the ASCII value of the character at the end of string rValue. (The character at the end of the string before the characters are shifted).
Str Ins Sub
"String Insert" Insert one string into the middle of another string. vSource is inserted into vDest before character position vInsertPosition. Similar to the InsertString function, except that this is a Subroutine which modifies its first argument instead of returning a value.
Strip Double Quotes Function
Strips surrounding double-quote characters from a string (if they exist).
Strip Left N Characters Function
Return the string vString with vNumChars characters removed from the left side of it.
Strip Right N Characters Function
Return the string vString with vNumChars characters removed from the right side of it.
Swap Characters Function
Swaps every other character within a string, so "ABCD" becomes "BADC". Strings with an odd number of characters have their last character retained. as in example #2.
Truncate Left With Ellipse Function
Truncate/remove the left part of the string vLine if it is longer than vMaxLen, If the string is truncated, replace the leading characters with "..." to indicate the removal.
Truncate Right With Ellipse Function
Truncate the left of a string if it is longer than MaxLen, If the string is truncated, replace the leading characters with "..." to indicate the removal.

This Windows-based ActiveX DLL provides many useful routines through its function-bearing and data structure classes. Consult the Help file for more information, or call us at 1-310-472-3736. For the latest news and files, visit our home page on the World Wide Web: http://www.entisoft.com

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.