Trim: Difference between revisions
Jump to navigation
Jump to search
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'') | |||
== Description == | |||
Trim returns a string with all leading and trailing spaces removed. The required parameter, ''string'', is any valid string expression. | |||
== Example (Basic) == | |||
<pre> | <pre> | ||
Rem Trim Example | |||
' | 'Trim trims leading and trailing spaces | ||
Dim Spacey | |||
Spacey = " K " | Spacey = " K " | ||
Print "(" & Spacey & ")" | |||
Print "(" & Trim(Spacey) & ")" | |||
</pre> | </pre> | ||
== 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 == | |||
[[ltrim|LTrim]], [[rtrim|RTrim]] | |||
[[Category:Language Reference]] | |||
[[ | [[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)