Navigation:  thinBasic language > Modules > Core > String handling >

EXTRACT$

Previous pageReturn to chapter overviewNext page

 

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)

 

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. If the ANY keyword is included, MatchString specifies a list of single characters to be searched for individually.

 

Remarks

 

Restrictions

 

See also

 

String Handling,

 

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.6.0.10 Web Site: http://www.thinbasic.com