Home > Contents > Index >
Template Tag TOC  |   Alpha TOC  |   Tag Family TOC  |   Purpose TOC  |   Annotated TOC  |   Index 

 

INDEXOF

Finds the index of a string within a string.

Syntax

Parameters

STR (required)
String to search.

WHAT (required)
Value of the string to search for within STRING_VALUE.

OUTSTR (required)
Name of the variable to store the offset into STRING_VALUE of the SEARCH_STRING.

INDEX (required)
Offset in the source string to begin the search. The default for this parameter is 0.

Description

The INDEXOF tag finds the index of a specified string within another string. For more information about variables, see the CS Developer's Guide.

errno

The possible values of errno include:

Value
Description
1
Substring was found.
0
Substring was not found.

Example

This example looks for the index of test within the string, "This is a test".

The browser displays:

The following example sets the outstr variable to -1 if the string isn't found:

The value of myindex1 is:

See Also

BEGINS , ENDS

  Home > Contents > Index >

FatWire XML Tag Reference
Copyright 2005 by FatWire Software
All rights reserved.