SpanExcluding

Description

Searches the string strSource for the first occurrence of any character in the specified set string strExclude. SpanExcluding extracts and returns all characters preceding the first occurrence of a character from strExclude(in other words, the character from strExclude and all characters following it in strSource, are not returned). If no character from strExclude is found in the string, then SpanExcluding returns the entire string. Case sensitive.

Syntax

string SpanExcluding(string strSource$, string strExclude$ )$

Parameters

strSource

is the string to search.

strExclude

is the string with a set of characters to exclude.

Return

A substring that contains characters in the string strSource that are not in strExclude, starting with the first character in the string and up to but excluding the first character in the string that is found strExclude). It returns the entire string if no character in strExclude is found in the string.

Example

str1$= "Hello World! Goodbye!";
str2$ = "ho";
SpanExcluding(str1$, str2$)$= ; //should return Hell
//Notes: it is best to pass a string variable into this method,
//because in Labtalk method, string will always pass as Uppercase,
//but this method is case sensitive.

See Also

SpanIncluding