Map and Table Calculation

STRPOS( ) function

Returns the starting position of the second string (i.e. the substring) in the first string.

Syntax

STRPOS(String a,"String b")

Input

String a is a string
Domain type: any Class or ID domain, or system domain String
String b is a string
Domain type: any Class or ID domain, or system domain String

Output

STRPOS returns: an integer value
Domain type: system domain Value

Note:

When one of the input parameters is undefined, or when both input parameters are undefined, the output will also be undefined.

Tips:

Usable in

TabCalc, Simple calculators

Examples

Pocket line calculator examples:

? STRPOS("Commercial","mm")

returns 3

? STRPOS("Landuse","p")

returns 0

TabCalc example:

OutCol = STRPOS(InCol,"slope")

 

InCol

OutCol

Active alluvial fan

0

Denudational steep to very steep slopes

34

Denudational moderately steep slopes

31

?

?

Fault-line scarp

0

Fault-related hills

0

Steep face-slopes

12

Infilled lake

0

Steep dipslopes

10

Applied example:

The next example uses the cross table of a Landuse map and a Geomorphology map.

OutCol = STRPOS(InCol, "* ") + 2

InCol

OutCol

Bare rock * Glacial slope

13

Bare rock * Glacial lake

13

Grassland * Old landslide

13

Grassland * Active landslide

13

Bare soils * Heavily eroded area

14

Bare soils * Hills near a fault

14

Forest * Valley in alluvial fan

10

Shrubs * Alluvial fan (flooding possible)

10

Urban periphery * Infilled lake

19

 

In column OutCol the starting position is found of sub-string * followed by a space. Then 2 is added to find the real starting position of the geomorphological description.

See also:

STRGE