Rtrim: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''
RTrim(''string'')
RTrim(''string'')


Line 14: Line 16:
Print "(" & Spacey & ")"
Print "(" & Spacey & ")"
Print "(" & RTrim(Spacey) & ")"
Print "(" & RTrim(Spacey) & ")"
</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 + ")" + "<br>");
NSB.Print("(" + Spacey.rtrim() + ")" + "<br>");
</pre>
</pre>


Line 45: Line 32:


[[Category:Strings]]
[[Category:Strings]]
[[Category:BASIC Functions]]

Latest revision as of 15:33, 25 March 2019

This function is for BASIC compatibility. It is not available in pure JavaScript projects.

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) & ")"

Output

(K )
(K)

Related Items

LTrim, Trim