RTRIM$: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "The {{KW|RTRIM$}} function removes trailing space characters from a {{KW|STRING}} value. {{PageSyntax}} :{{parameter|return$}} = {{KW|RTRIM$}}({{Parameter|value$}}) {{PageDescription}} * {{Parameter|value$}} is the {{KW|STRING}} value to trim. * If {{Parameter|value$}} contains no trailing space characters, {{Parameter|value$}} is returned unchanged. * Convert fixed length {{KW|STRING}} values by using a different {{parameter|return$}} variable. {{PageExamples}} T...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
The {{KW|RTRIM$}} function removes trailing space characters from a {{KW|STRING}} value.
The [[RTRIM$]] function removes trailing space characters from a [[STRING]] value.




{{PageSyntax}}
{{PageSyntax}}
:{{parameter|return$}} = {{KW|RTRIM$}}({{Parameter|value$}})
:{{parameter|return$}} = [[RTRIM$]]({{Parameter|value$}})




{{PageDescription}}
{{PageDescription}}
* {{Parameter|value$}} is the {{KW|STRING}} value to trim.
* {{Parameter|value$}} is the [[STRING]] value to trim.
* If {{Parameter|value$}} contains no trailing space characters, {{Parameter|value$}} is returned unchanged.
* If {{Parameter|value$}} contains no trailing space characters, {{Parameter|value$}} is returned unchanged.
* Convert fixed length {{KW|STRING}} values by using a different {{parameter|return$}} variable.
* Convert fixed length [[STRING]] values by using a different {{parameter|return$}} variable.
 




Line 17: Line 16:
{{CodeStart}}
{{CodeStart}}
name$ = {{Cl|RTRIM$}}(contact.name) ' trims spaces from end of fixed length {{Cl|TYPE}} value.
name$ = {{Cl|RTRIM$}}(contact.name) ' trims spaces from end of fixed length {{Cl|TYPE}} value.
{{CodeEnd}}  
{{CodeEnd}}


Trimming text string ends:
Trimming text string ends:
Line 31: Line 30:


{{PageSeeAlso}}
{{PageSeeAlso}}
* {{KW|LTRIM$}}, {{KW|STR$}}
* [https://qb64phoenix.com/forum/showthread.php?tid=1246 Featured in our "Keyword of the Day" series]
 
* [[_TRIM$]], [[LTRIM$]], [[STR$]]
* {{KW|LSET}}, {{KW|RSET}}
* [[LSET]], [[RSET]]




{{PageNavigation}}
{{PageNavigation}}

Latest revision as of 17:41, 25 May 2024

The RTRIM$ function removes trailing space characters from a STRING value.


Syntax

return$ = RTRIM$(value$)


Description

  • value$ is the STRING value to trim.
  • If value$ contains no trailing space characters, value$ is returned unchanged.
  • Convert fixed length STRING values by using a different return$ variable.


Examples

Trimming a fixed length string value for use by another string variable:

name$ = RTRIM$(contact.name) ' trims spaces from end of fixed length TYPE value.

Trimming text string ends:

PRINT RTRIM$("some text") + "."
PRINT RTRIM$("some text   ") + "."
PRINT RTRIM$("Tommy    ")
some text.
some text.
Tommy


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link