Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

RTrim

RTrim(cText) -> cRet

Removes trailing spaces while preserving the beginning.

RTrimAdvPL
01 · OVERVIEW

Overview

Trims trailing spaces into a new string. It is not a general normalizer for tabs, line endings or Unicode whitespace. Unlike AllTrim, leading spaces remain. Brackets make preserved spaces visible in this example. Do not trim fixed-width key components indiscriminately before a seek. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

RTrim(cText) -> cRet

Parameters

cText
CharacterRequired

Source string.

Return value

Character without trailing spaces.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed639()
    // Memory-only operation; input remains unchanged.
    ConOut("["+RTrim("  ABC  ")+"]")
Return Nil
Expected result

Expected result: [ ABC]. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check types, bounds and context before using external input.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. RTrim. TDN. Accessed on 2026-10-28.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha