basic.count

Function/BASIC Program, Releases: AP and R83

Counts number of occurences of a string within another string.

Syntax

count(string.expression1,string.expression2)

Description

returns the number of occurrences of 'string.expression2' within 'string.expression1'.

Example

sentence = 'sam is home alone'
print count(sentence,' ')

This displays the number of spaces in the string held in the variable
'sentence', which is equal to 3.

See Also

Command Name Type Description
basic.statements Definition Definition of statements and functions.
basic.string.expression Definition An expression which evaluates to a string.
string.expressions Definition A string of characters.
basic.occurs Function Locates strings which occur certain number of times.
basic.procread Statement Reads primary input buffer.
basic.functions Definition elements in FlashBASIC or Pick/BASIC language expressions, returning a single value in place, as a function of the arguments. A function can be used anywhere a variable or expression is used.
basic.fold Function Folds string.
basic.dcount Function Returns count of strings delimited by a given delimiter.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.