LTrim: Difference between revisions
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
LTrim returns a string with all leading spaces removed. The required parameter, ''string'', is any valid string expression. | LTrim returns a string with all leading spaces removed. The required parameter, ''string'', is any valid string expression. | ||
== Example == | == Example (Basic) == | ||
<pre> | <pre> | ||
Line 14: | Line 14: | ||
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 21:34, 19 May 2013
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)