Lasso Soft Inc. > Home

[ string->find ]

Method

[String->Find] returns the position at which the first parameter is found the first time within the string object, or 0 if the first parameter is not found within the string object. Requires a single string parameter. The pattern is not case sensitive. An optional -Case parameter compares the string taking case into account.

Optional -offset and -length parameters allow a portion of the string object to be searched by specifying the offset at which to start searching and the number of characters from the offset to search, respectively. -Offset defaults to the start of the search string. If omitted, -length defaults to searching to the end of the string.

Optional -patoffset and -patlength parameters allow a portion of the pattern to be used as the search pattern by specifying the offset into the pattern and the number of characters from the pattern to search for, respectively. -Patoffset defaults to the start of the pattern. If omitted, -pathlength defaults to searching for the entire pattern from the offset until the end.

  • Syntax
'String Object'->find('String Pattern')
'String Object'->find('String Pattern', -case)
'String Object'->find('String Pattern', -offset=integer, -length=integer)
'String Object'->find('String Pattern', -offset=integer, -length=integer, -patoffset=integer, -patlength=integer)
Examples
  • Beginner

To find the location of a substring within a string:

Use the [String->Find] method. The following example finds the position of the word Soft within the string LassoSoft.

Code

'LassoSoft'->find('Soft')

Result

6

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 2014 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft