Trim: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Brendon (talk | contribs)
Created page with "TRIM(''string'') '''Description''' TRIM returns a string with all leading and trailing spaces removed. The required parameter, ''string'', is any valid string expression. '..."
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
TRIM(''string'')
Trim(''string'')


'''Description'''
== Description ==


TRIM returns a string with all leading and trailing spaces removed. The required parameter, ''string'', is any valid string expression.
Trim returns a string with all leading and trailing spaces removed. The required parameter, ''string'', is any valid string expression.


'''Example'''
== Example (Basic) ==


<pre>
<pre>
REM TRIM Example
Rem Trim Example
'TRIM trims leading and trailing spaces
'Trim trims leading and trailing spaces
DIM Spacey
Dim Spacey
Spacey = " K "
Spacey = " K "
PRINT "(" & Spacey & ")"
Print "(" & Spacey & ")"
PRINT "(" & TRIM(Spacey) & ")"
Print "(" & Trim(Spacey) & ")"
</pre>
</pre>


'''Output'''
== Example (Basic) ==
 
<pre>
// Trim Example
/* Trim trims leading and trailing spaces */
 
var Spacey;
Spacey = " K ";
NSB.Print("(" + Spacey + ")");
NSB.Print("(" + Spacey.trim() + ")");
</pre>
 
== Output ==


<pre>
<pre>
Line 23: Line 35:
</pre>
</pre>


'''Related Items'''
== Related Items ==
 
[[ltrim|LTrim]], [[rtrim|RTrim]]
 
[[Category:Language Reference]]


[[ltrim|LTRIM]], [[rtrim|RTRIM]]
[[Category:BASIC Functions]]

Latest revision as of 15:37, 25 March 2019

Trim(string)

Description

Trim returns a string with all leading and trailing spaces removed. The required parameter, string, is any valid string expression.

Example (Basic)

Rem Trim Example
'Trim trims leading and trailing spaces
Dim Spacey
Spacey = " K "
Print "(" & Spacey & ")"
Print "(" & Trim(Spacey) & ")"

Example (Basic)

// Trim Example
/* Trim trims leading and trailing spaces */

var Spacey;
Spacey = " K ";
NSB.Print("(" + Spacey + ")");
NSB.Print("(" + Spacey.trim() + ")");

Output

( K )
(K)

Related Items

LTrim, RTrim