CT_COUNTRIGHT

 COUNTRIGHT()
 Counts a particular character at the end of a string
------------------------------------------------------------------------------
 Syntax

     COUNTRIGHT(<cString>,[<cCharacter|nCharacter>]) --> nNumber

 Arguments

     <cString>  Designates the character string in which the
     <cCharacter|nCharacter> character is counted.

     <cCharacter|nCharacter>  Designates the character at the end of the
     <cString> that is counted.  The default value is a space, CHR(32).

 Returns

     COUNTRIGHT() returns the number of <cCharacter|nCharacter> characters
     that appear in an uninterrupted sequence at the end of the <cString>.

 Description

     While REMRIGHT() removes trailing characters from the <cString>,
     COUNTRIGHT() only determines the number of trailing <cCharacter|
     nCharacter> characters appearing in an uninterrupted sequence at the end
     of the <cString>.

 Examples

     .  Count the blanks:

        ? COUNTRIGHT("abc   ")            // Result: 3

     .  Count the "." characters:

        ? COUNTRIGHT("abc.d..", ".")      // Result: 2

     .  In this example, there are no spaces to count:

        ? COUNTRIGHT("123456")             // Result: 0

See Also: COUNTLEFT()



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.