LTRIM$

From QB64 Wiki
Revision as of 02:21, 1 March 2010 by imported>Clippy (example)
Jump to navigation Jump to search

The LTRIM$ function removes leading space characters from a STRING value.


Syntax

result = LTRIM$(value$)


Description

  • value$ is the STRING value to trim.
  • If value$ contains no leading space characters, value$ is returned unchanged.
  • Cannot alter fixed length STRING variables. Convert using a non-fixed variable.
  • Can be used with STR$ to trim a numerical value converted to a string value.


Examples

Trimming a fixed length string value for use by another string variable:

name$ = LTRIM$(contact.name) ' trims spaces from front of fixed length TYPEvalue.


Trimming a positive string number:

number$ = LTRIM$(STR$(value))


Trimming text strings:

PRINT LTRIM$("some text") PRINT LTRIM$(" some text")

some text some text


See also



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page