Rtrim: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
RTrim(''string'') | |||
== Description == | |||
RTrim returns string with all trailing spaces removed. The required parameter, ''string'', is any valid string expression. | |||
== Example == | |||
<pre> | <pre> | ||
Rem RTrim Example | |||
' | 'RTrim trims all trailing spaces | ||
Dim Spacey | |||
Spacey = "K " | Spacey = "K " | ||
Print "(" & Spacey & ")" | |||
Print "(" & RTrim(Spacey) & ")" | |||
</pre> | </pre> | ||
== Example (JavaScript) == | |||
<pre> | |||
// RTrim Example | |||
/* RTrim trims all trailing spaces */ | |||
String.prototype.rtrim = function() { | |||
return this.replace(/\s+$/,""); | |||
} | |||
var Spacey; | |||
Spacey = "K "; | |||
NSB.Print("(" + Spacey + ")"); | |||
NSB.Print("(" + Spacey.rtrim() + ")"); | |||
</pre> | |||
== Output == | |||
<pre> | <pre> | ||
Line 23: | Line 38: | ||
</pre> | </pre> | ||
== Related Items == | |||
[[ltrim|LTrim]], [[trim|Trim]] | |||
[[Category:Language Reference]] | |||
[[ | [[Category:Strings]] |
Revision as of 21:34, 19 May 2013
RTrim(string)
Description
RTrim returns string with all trailing spaces removed. The required parameter, string, is any valid string expression.
Example
Rem RTrim Example 'RTrim trims all trailing spaces Dim Spacey Spacey = "K " Print "(" & Spacey & ")" Print "(" & RTrim(Spacey) & ")"
Example (JavaScript)
// RTrim Example /* RTrim trims all trailing spaces */ String.prototype.rtrim = function() { return this.replace(/\s+$/,""); } var Spacey; Spacey = "K "; NSB.Print("(" + Spacey + ")"); NSB.Print("(" + Spacey.rtrim() + ")");
Output
(K ) (K)