Rtrim

From NSB App Studio
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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 + ")" + "<br>");
NSB.Print("(" + Spacey.rtrim() + ")" + "<br>");

Output

(K )
(K)

Related Items

LTrim, Trim