CountRight()

CountRight()

Count a certain character at the end of a string

Syntax

       CountRight( <cString>, [<cSearch|nSearch>] ) -> nCount

Arguments

<cString> Designates the character string in which the <cSearch|nSearch> character is Counted.

<cSearch|nSearch> 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 <cSearch|nSearch> 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 <cSearch|nSearch> 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

Compliance

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

Platforms

All

Files

Source is Count.c, library is libct.

Seealso

CountLeft()

Advertisements

2 responses to “CountRight()

  1. Pingback: Harbour String Functions | Viva Clipper !

  2. Pingback: Harbour All Functions – C | Viva Clipper !

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s