Trim: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(One intermediate revision by one other user not shown) | |||
Line 5: | Line 5: | ||
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> | ||
Line 14: | Line 14: | ||
Print "(" & Spacey & ")" | Print "(" & Spacey & ")" | ||
Print "(" & Trim(Spacey) & ")" | Print "(" & Trim(Spacey) & ")" | ||
</pre> | |||
== Example (Basic) == | |||
<pre> | |||
// Trim Example | |||
/* Trim trims leading and trailing spaces */ | |||
var Spacey; | |||
Spacey = " K "; | |||
NSB.Print("(" + Spacey + ")"); | |||
NSB.Print("(" + Spacey.trim() + ")"); | |||
</pre> | </pre> | ||
Line 28: | Line 40: | ||
[[Category:Language Reference]] | [[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)