LTrim

From NSB App Studio
Jump to: navigation, search

LTrim(string)

Description

LTrim returns a string with all leading spaces removed. The required parameter, string, is any valid string expression.

Example (Basic)

Rem LTrim Example
'LTrim trims all leading spaces
Dim Spacey
Spacey = " K"
Print "(" & Spacey & ")"
Print "(" & LTrim(Spacey) & ")"

Example (JavaScript)

// LTrim Example
/* LTrim trims all leading spaces */

String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}

var Spacey;
Spacey = " K";
NSB.Print("(" + Spacey + ")");
NSB.Print("(" + Spacey.ltrim() + ")");

Output

( K)
(K)

Related Items

RTrim, Trim