<cfx_kmString> cfx_kmSuite
Programming Reference

cfx_kmString contains functions related to string management and display.

Abbreviate
DeleteBetweenChars
Ellipsiate
ExtractBetweenChars
ForceCRLF
Help
IncString
SortChars
SqueezeAllBlanks
SqueezeCharacters
SqueezeExtraBlanks
StripCRLF
TabsIn
TabsOut
Version
WordCount
WordGetNumbered
WordPosOfNumbered
WordReplace
WordReplaceNumbered
WordSlice
WrapText


F=Abbreviate

Description
Abbreviate a text string to the specified length. The abbreviation is performed by removing vowels and other characters until the target length is hit. Legibility of the result depends on the severity of the abbreviation.
Returns
Abbreviated text.
Syntax
  <cfx_kmString  F=Abbreviate  V=variable  SHOW
      STRING=text-string
      LENGTH=number >
Attribute   Description         Required?
STRING  Any text string.  YES
LENGTH  Maximum abbreviated length (default=74)  no


Examples

<cfx_kmString F=Abbreviate LENGTH=15
    STRING="Department of Strange Words">
Result:  Dprt of Str Wrd



F=DeleteBetweenChars

Delete the text found between two specified characters in a string.

Returns
The original string with text deleted.
Syntax
  <cfx_kmString  F=DeleteBetweenChars  V=variable  SHOW
      STRING=text-string
      CHAR1=character
      CHAR2=character
      INCLUSIVE >
Attribute   Description         Required?
STRING  Any text string.  YES
CHAR1  First character to search for.  YES
CHAR2  Second character to search for.  YES
INCLUSIVE  If the attribute is present, the enclosing characters are deleted along with the text.  no



F=Ellipsiate

Abbreviate a text string to the specified length. The abbreviation is performed by removing the "center' of the the string and replacing it with ellipses (three periods).

Returns
Ellipsiated text.
Syntax
  <cfx_kmString  F=Ellipsiate  V=variable  SHOW
      STRING=text-string
      LENGTH=number >
Attribute   Description         Required?
STRING  Any text string.  YES
LENGTH  Maximum abbreviated length (default=74)  no


Examples

<cfx_kmString F=Ellipsiate LENGTH=15
    STRING="Department of Strange Words">
Result:  Departme...e Words



F=ExtractBetweenChars

Locate and return the text found between two specified characters in a string.

Returns
The text found between the characters.
Syntax
  <cfx_kmString  F=ExtractBetweenChars  V=variable  SHOW
      STRING=text-string
      CHAR1=character
      CHAR2=character
      INCLUSIVE >
Attribute   Description         Required?
STRING  Any text string.  YES
CHAR1  First character to search for.  YES
CHAR2  Second character to search for.  YES
INCLUSIVE  If the attribute is present, return the enclosing characters with the text.  no


F=ForceCRLF

Force proper CR/LF line terminators in a text. Line terminators consisting of any combination of CR and LF characters are converted to standard CR/LF.

Returns
Text with CR/LF line endings.
Syntax
  <cfx_kmString  F=ForceCRLF  V=variable  SHOW
      STRING=text-string >
Attribute   Description         Required?
STRING  Any text string.  YES


F=IncString

Increment an alpha-number string, based on ASCII character values a-z, A-Z and 0-9.

Returns
Incremented string.
Syntax
  <cfx_kmString  F=IncString  V=variable  SHOW
      STRING=text-string >
Attribute   Description         Required?
STRING  An alpha-numeric string  YES


Examples

<cfx_kmString F=IncString STRING="CZ999">
<cfx_kmString F=IncString STRING="199zZz">
<cfx_kmString F=IncString STRING="199ZzZ">
Result:  DA000
200aAa
200AaA



F=SortChars

Sort all of the characters in a text string. The result is probably not useful.

Returns
Sorted text.
Syntax
  <cfx_kmString  F=SortChars  V=variable  SHOW
      STRING=text-string >
Attribute   Description         Required?
STRING  Any text string.  YES


Examples

<cfx_kmString F=SortChars STRING="Mary had a little lamb.">
Result:  .Maaaabdehilllmrtty



F=SqueezeAllBlanks

Remove all blank characters from a text.

Returns
Squozen text.
Syntax
  <cfx_kmString  F=SqueezeAllBlanks  V=variable  SHOW
      STRING=text-string >
Attribute   Description         Required?
STRING  Any text string.  YES


Examples

<cfx_kmString F=SqueezeAllBlanks STRING="Mary had a little lamb.">
Result:  Maryhadalittlelamb.



F=SqueezeCharacters

Remove all specified characters from a text.

Returns
Squozen text.
Syntax
  <cfx_kmString  F=SqueezeCharacters  V=variable  SHOW
      STRING=text-string
      CHARS=text-string >
Attribute   Description         Required?
STRING  Any text string.  YES
CHARS  String containing characters to squeeze.  YES


Examples

<cfx_kmString F=SqueezeCharacters CHARS="Mmt"
    STRING="Mary had a little lamb.">
Result:  ary had a lile lab.



F=SqueezeExtraBlanks

Remove extra (consecutive) blank characters from a text.

Returns
Squozen text.
Syntax
  <cfx_kmString  F=SqueezeExtraBlanks  V=variable  SHOW
      STRING=text-string >
Attribute   Description         Required?
STRING  Any text string.  YES


Examples

<cfx_kmString F=SqueezeExtraBlanks
    STRING="Mary had a    little    lamb.">
Result:  Mary had a little lamb.



F=StripCRLF

Delete CR/LF line terminators from a text.

Returns
Processed text.
Syntax
  <cfx_kmString  F=StripCRLF  V=variable  SHOW
      STRING=text-string
      PRESERVE_DOUBLE >
Attribute   Description         Required?
STRING  Any text string.  YES
PRESERVE_DOUBLE  Double pairs of CR/LF characters are often used to indicate paragraph breaks. If the PRESERVE_DOUBLE attribute is present, the double pairs (and thus the paragraph breaks) will be preserved.  no


F=TabsIn

Replace spaces with tab characters in a given string.

Returns
Text with tabs.
Syntax
  <cfx_kmString  F=TabsIn  V=variable  SHOW
      STRING=text-string
      TABSIZE=number >
Attribute   Description         Required?
STRING  Any text string.  YES
TABSIZE  Tab length, default=6.  YES


F=TabsOut

Replace tab characters with spaces in a given text string.

Returns
Text without tabs.
Syntax
  <cfx_kmString  F=TabsOut  V=variable  SHOW
      STRING=text-string
      TABSIZE=number >
Attribute   Description         Required?
STRING  Any text string.  YES
TABSIZE  Tab length, default=6.  YES


F=WordCount

Count the words in a given text string.

Returns
Numeric word count.
Syntax
  <cfx_kmString  F=WordCount  V=variable  SHOW
      STRING=text-string
      DELIMITERS=text-string
      QUOTERS=text-string >
Attribute   Description         Required?
STRING  Any text string.  YES
DELIMITERS  String containing the desired word delimiter characters (default=spaces, punctuation, parentheses, etc.)  no
QUOTERS  String containing the desired word quoting characters (default=single and double quotes)  no


Examples

<cfx_kmString F=WordCount STRING="Mary had a little lamb.">
Result:  5



F=WordGetNumbered

Return a numbered word in a text string.

Returns
Single word. If the numbered word doesn't exist, the return value is empty.
Syntax
  <cfx_kmString  F=WordGetNumbered  V=variable  SHOW
      STRING=text-string
      WORDNUM=word-number
      DELIMITERS=text-string
      QUOTERS=text-string >
Attribute   Description         Required?
STRING  Any text string.  YES
WORDNUM  Desired word number. The first word is number 1.  YES
DELIMITERS  String containing the desired word delimiter characters (default=spaces, punctuation, parentheses, etc.)  no
QUOTERS  String containing the desired word quoting characters (default=single and double quotes)  no


Examples

<cfx_kmString F=WordGetNumbered WORDNUM=4
    STRING="Mary had a little lamb.">
Result:  little



F=WordPosOfNumbered

Return the position of a numbered word in a text string.

Returns
Numeric position. If the numbered word doesn't exist, the return value is zero.
Syntax
  <cfx_kmString  F=WordPosOfNumbered  V=variable  SHOW
      STRING=text-string
      WORDNUM=word-number
      DELIMITERS=text-string
      QUOTERS=text-string >
Attribute   Description         Required?
STRING  Any text string.  YES
WORDNUM  Desired word number. The first word is number 1.  YES
DELIMITERS  String containing the desired word delimiter characters (default=spaces, punctuation, parentheses, etc.)  no
QUOTERS  String containing the desired word quoting characters (default=single and double quotes)  no


Examples

<cfx_kmString F=WordPosOfNumbered WORDNUM=4
    STRING="Mary had a little lamb.">
Result:  12



F=WordReplace

Replace a specified word in a text string with a new number.

Returns
Text with the new word.
Syntax
  <cfx_kmString  F=WordReplace  V=variable  SHOW
      STRING=text-string
      WORD=text-string
      NEWWORD=text-string
      SENSITIVE="Yes" or "No"
      DELIMITERS=text-string
      QUOTERS=text-string >
Attribute   Description         Required?
STRING  Any text string.  YES
WORD  Word to find and replace.  YES
NEWWORD  Any text string.  YES
SENSITIVE  YES=Word search is case sensitive (default=NO).  no
DELIMITERS  String containing the desired word delimiter characters (default=spaces, punctuation, parentheses, etc.)  no
QUOTERS  String containing the desired word quoting characters (default=single and double quotes)  no


Examples

<cfx_kmString F=WordReplace WORD="little" NEWWORD="vicious"
    STRING="Mary had a little lamb.">
<cfx_kmString F=WordReplace WORD="mary" NEWWORD="Edgar" SENSITIVE=YES
    STRING="Mary had a little lamb named mary.">
Result:  Mary had a vicious lamb.
Mary had a little lamb named Edgar



F=WordReplaceNumbered

Replace a numbered word in a text string with a new word.

Returns
Text with the new word.
Syntax
  <cfx_kmString  F=WordReplaceNumbered  V=variable  SHOW
      STRING=text-string
      WORDNUM=word-number
      NEWWORD=text-string
      DELIMITERS=text-string
      QUOTERS=text-string >
Attribute   Description         Required?
STRING  Any text string.  YES
WORDNUM  Word number.  YES
NEWWORD  Any text string.  YES
DELIMITERS  String containing the desired word delimiter characters (default=spaces, punctuation, parentheses, etc.)  no
QUOTERS  String containing the desired word quoting characters (default=single and double quotes)  no


Examples

<cfx_kmString F=WordReplaceNumbered WORDNUM=4 NEWWORD="vicious"
    STRING="Mary had a little lamb.">
Result:  Mary had a vicious lamb.



F=WordSlice

Extract a span of words from a string.

Returns
String containing the requested range of words.
Syntax
  <cfx_kmString  F=WordSlice  V=variable  SHOW
      STRING=text-string
      START=word-number
      END==word-number
      DELIMITERS=text-string
      QUOTERS=text-string >
Attribute   Description         Required?
STRING  Any text string.  YES
DELIMITERS  String containing the desired word delimiter characters (default=spaces, punctuation, parentheses, etc.)  no
QUOTERS  String containing the desired word quoting characters (default=single and double quotes)  no


F=WrapText

Wrap text at the specified column width. Text is wrapped by adding carriage-return linefeed characters.

Returns
Wrapped text.
Syntax
  <cfx_kmString  F=WrapText  V=variable  SHOW
      STRING=text-string
      WIDTH=number >
Attribute   Description         Required?
STRING  Any text string.  YES
WIDTH  Wrap column width.  YES