Trim$: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
m (1 revision)
 
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  Trim$(A$[,"char"])
  TRIM$(<string>[,"<character>"])


The '''Trim$''' [[internal function]] can now be used to delete both leading and trailing blanks from the [[string]] A$. Trim$(A$) returns the same value as RTrm$(LTrm$(A$)). The optional "char" parameter can be used to specify the character (instead of blanks) to strip; this parameter is limited to one character in length. [[Nulls]] (Chr$(0)) are allowed.
The '''Trim$''' [[internal function]] can be used to delete both leading and trailing blanks from the [[string]] A$. Trim$(A$) returns the same value as RTrm$(LTrm$(A$)). The optional "char" parameter can be used to specify the character (instead of blanks) to strip; this parameter is limited to one character in length. [[Null]]s (Chr$(0)) are allowed.
 
====Example====
 
00010 print trim$("    The leading blanks will be removed. So will the trailing ones      ")&"..."
00020 print trim$("*****The leading  stars will be removed. So will the trailing ones******","*")
 
Output:
 
The leading blanks will be removed. So will the trailing ones...
The leading  stars will be removed. So will the trailing ones


====See also====
====See also====
*[[RTrm$]]
*[[RTrm$]]
*[[LTrm$]]
*[[LTrm$]]

Latest revision as of 03:17, 22 May 2014

TRIM$(<string>[,"<character>"])

The Trim$ internal function can be used to delete both leading and trailing blanks from the string A$. Trim$(A$) returns the same value as RTrm$(LTrm$(A$)). The optional "char" parameter can be used to specify the character (instead of blanks) to strip; this parameter is limited to one character in length. Nulls (Chr$(0)) are allowed.

Example

00010 print trim$("     The leading blanks will be removed. So will the trailing ones      ")&"..."
00020 print trim$("*****The leading  stars will be removed. So will the trailing ones******","*")

Output:

The leading blanks will be removed. So will the trailing ones... 
The leading  stars will be removed. So will the trailing ones

See also