Lasso Soft Inc. > Home

[ String->Sub ]

Method

[String->Sub] returns a substring from a string object. The first parameter is required and defines the starting position of the substring. A second optional parameter defines the length of the substring to return, and defaults to the size of the string object. Both parameters must be integers.

[String->Sub] is an abbreviation for the [String->Substring] method.

  • Syntax
'String Object'->sub(Starting Position)
'String Object'->sub(Starting Position, Length)
Examples
  • Beginner

To return characters of a string from an offset position:

Use the [String->Sub] method. The following example returns a substring starting at the eleventh position with a length of five characters.

Code

'The quick white rhino'->sub(11,5)

Result

white

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft