JustRight()

JustRight()

Move characters from the end to the beginning of a string

Syntax

       JustRight( <[@]cString>, [<cChar>|<nChar>] ) -> cJustifiedString

Arguments

<cString> [@] Designates the string that is processed. <cCharacter|nCharacter> Designates the character that is moved from the end of the <cString> to the beginning. The default value is a space, CHR(32).

Returns

The processed <cString> is returned.

Description

JustRight() moves the characters specified in <cCharacter| nCharacter> from the end of a character string to the beginning. Then the remaining text in the character string is right justified, without affecting the length.

Notes

. If the <cCharacter|nCharacter> parameter is not specified, spaces are automatically moved. . The return value for this function can be suppressed by implementing CSETREF() to save room in working memory.

Examples

       .  Move the blanks
              ? JustRight("123   ")           // "   123"
           .  Move the "." character
              ? JustRight("123..", ".")       // "..123 "

Compliance

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

Platforms

All

Files

Source is justify.c, library is libct.

Seealso

JustLeft(), CSetRef(), Introduction

2 responses to “JustRight()

  1. Pingback: Harbour All Functions – J | Viva Clipper !

  2. Pingback: Harbour String Functions | 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 )

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.