Navigation: thinBasic Modules > Core > String handling > EXTRACT$ |
|
Description
Return the portion of a string leading up to the first occurrence of a specified character or string.
Syntax
s = EXTRACT$([Start,] MainString, [ANY] MatchString [, CaseSensitive])
Returns
String
Parameters
Name |
Type |
Optional |
Meaning |
Start |
Number |
Yes |
Optional starting position in MainString |
MainString |
String |
No |
String to search in |
MatchString |
String |
No |
String to search for. |
CaseSensitive |
Number |
Yes |
Optional parameter used to indicate if match must be case sensitive or not. Use %TRUE or %FALSE. Default value is %TRUE |
Remarks
If the ANY keyword is specified, MatchString specifies a list of single characters to be searched for individually.
Restrictions
See also
Examples
Script example
' FirstItem = first command-line argument, assuming
' spaces, commas, periods, and tabs are valid delimiters
FirstItem = EXTRACT$(COMMAND$, ANY " ,." + CHR$(9))
© 2004-2008 thinBasic. All rights reserved. | Version 1.7.0.0 | Web Site: http://www.thinbasic.com |