Command Prompt for Windows




Command STRFIND

Function:

Find the first occurrence of a string within the specified text. The index where the string occurs is stored in an environment variable called STRFIND.

Syntax:

STRFIND "string" [text]
stringA string that specifies the string to find.
textA sequence of characters.

Note:

When the string does not occur within the text then the environment variable STRFIND will be set to 0.

The first character in the text is at position 1, the second character is at position 2 and so on.

Also see command STRRFIND, SUBSTR, STRSPLIT and Batch Files.