CharNoList()

CHARNOLIST()

Generates a list of all characters not contained in a string

Syntax

      CHARNOLIST( [<cString>] ) -> cCharacterList

Arguments

[<cString>] is the string for whom the function generates a list of all characters not contained in that string Default: “” (empty string)

Returns

<cCharacterList> a list of the characters that are not contained in <cString>

Description

The CHARNOLIST() function generates a list of those characters that are not contained in <cString>. This list can contain each character only once, so that its maximum length is 256. The list is alphabetically sorted.

Examples

      ? charnolist( charnolist( "Hello World !" ) ) // --> " !HWdelor"

Tests

      charnolist( charnolist( "Hello World !" ) ) == charslist( "Hello World !" )
      charnolist( charnolist( NIL ) ) == ""

Compliance

CHARNOLIST() is compatible with CT3’s CHARNOLIST().

Platforms

All

Files

Source is charlist.c, library is libct.

Seealso

CHARLIST(), CHARSLIST(), CHARHIST()

CharList()

CHARLIST()

Generates a list of all characters in a string

Syntax

      CHARLIST( [<cString>] ) -> cCharacterList

Arguments

[<cString>] is the string for whom the function generates a list of all characters Default: “” (empty string)

Returns

<cCharacterList> a list of the characters in <cString>

Description

The CHARLIST() function generates a list of those characters that are contained in <cString>. This list can contain each character only once, so that its maximum length is 256. The list lists those characters first that are occuring in <cString> first.

Examples

      ? charlist( "Hello World !" ) // --> "Helo Wrd!"

Tests

      charlist( "Hello World !" ) == "Helo Wrd!"
      charlist( NIL ) == ""

Compliance

CHARLIST() is compatible with CT3’s CHARLIST().

Platforms

All

Files

Source is charlist.c, library is libct.

Seealso

CHARNOLIST(), CHARSLIST(), CHARHIST()

CharHist()

CHARHIST()

Generates a character histogram of a string

Syntax

      CHARHIST( [<cString>] ) -> aCharacterCount

Arguments

[<cString>] is the string for whom the function generates a character histogram Default: “” (empty string)

Returns

<aCharacterCount> an array with 256 elements where the nth element contains the count of character #(n-1) in cString

Description

The CHARHIST() function generates a character histogram of those characters that are contained in <cString>. This histogram is stored in an 256-element array where the nth element contains the count of ASCII character #(n-1) in <cString>.

Examples

      ? charhist( "Hello World !" )[ 109 ] // --> 3  // Chr( 108 ) == "l"

Tests

      charhist( "Hello World !" )[ 109 ] == 3
      eval( {|| AEval( charhist( "Hello World !" ), {| x | nTotal += x } ), nTotal == Len( "Hello World !" ) }

Compliance

CHARHIST() is only available in Harbour’s CT3 library.

Platforms

All

Files

Source is charlist.c, library is libct.

Seealso

CHARLIST(), CHARNOLIST(), CHARSLIST()

Harbour All Functions – C

CD / CHDIR / DirChange

CDoW

Chr

CharAdd
CharAnd
CharEven
CharHist
CharList
CharMirr
CharMix
CharNoList
CharNot
CharOdd
CharOne
CharOnly
CharOr
CharPix
CharRela
CharRelRep
CharRem
CharRepl
CharRLL
CharRLR
CharSHL
CharSHR
CharSList
CharSort
CharSub
CharSwap
CharWin
CharXOR

CLIPINIT
CMonth

Col

Cos

CosH

CountLeft
CountRight

CToBit

CToD

CToDoW
CToF
CToMonth
CToN

CurDir

CSetArgErr
CSetAtMuPa
CSetRef
CTCExit
CTCInit
CTExit
CTInit