TU-Berlin | → | Inst. f. Mathematik | → | Algebra und Zahlentheorie | → | KASH | → | Documentation | → | Reference Manual

| KASH3 Reference Manual

Introduction | Reference Manual | Index

search

### Function

Position ( string S, char c ) -> elt-ord^rat

### Optional Arguments

Start | elt-ord^rat | (Default: 1) | Determines the position where the search is started.
Fail | any |  | Determines what to return in case of failure.

### Description

<shortdoc> Return the position of the first occurence of `c' in `S' if c is a character in the string `S', and FAILURE otherwise. </shortdoc>

### Examples

S:="foobar"; Position(S,'o'); Position(S,'f',rec(Start:=2)); Position(S,"foo");

| Built: Mon Nov 14 21:12:39 UTC 2005 on mack