LTrim: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''
LTrim(''string'')
LTrim(''string'')


Line 14: Line 16:
Print "(" & Spacey & ")"
Print "(" & Spacey & ")"
Print "(" & LTrim(Spacey) & ")"
Print "(" & LTrim(Spacey) & ")"
</pre>
== Example (JavaScript) ==
<pre>
// 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() + ")");
</pre>
</pre>



Revision as of 17:26, 24 March 2019

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

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

Output

( K)
(K)

Related Items

RTrim, Trim