vipsi - the friendly vip script interpreter

Functions

Numeric functions

find

mber> = Numeric functions: findfind ( <text>, <searchtext> )
mber> = Numeric functions: findfind ( <text>, <searchtext>, <startindex> )

Numeric functions: findFind first occurance of Flow control: if … then
Flow control: try … then
the
<searchtext> in <text>.

Flow control: returnReturns Numeric functions: indexindex of position found Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
0.

Optionally start search Operators: Make Identifier "@"at <startindex>. Search Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
must be a Glossary: text, text_valtext value Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
start Numeric functions: indexindex must be a numeric Glossary: Valuevalue. Flow control: if … then
Flow control: try … then
The
search starts Operators: Make Identifier "@"at Flow control: if … then
Flow control: try … then
the
start Numeric functions: indexindex inclusive.

Numeric functions: indexIndexes start Operators: Make Identifier "@"at 1.

e.g.:

vipsi> Numeric functions: findfind ( "hello world", "l" )  = 3
vipsi> Numeric functions: findfind ( "hello world", "X" )  = 0
vipsi> Numeric functions: findfind ( "hello world", "ll" )  = 3
vipsi> Numeric functions: findfind ( "hello world", "l", 6 )  = 10
vipsi> Numeric functions: findfind ( "hello world", "l", 4 )  = 4
vipsi> Numeric functions: findfind ( "hello world", "ll", 4 )  = 0
vipsi> Numeric functions: findfind ( "hello world", "ll", 3 )  = 3
vipsi> Numeric functions: findfind ( "hello world", "ll", 2 )  = 3
vipsi>  

Valid HTML   Valid CSS