FIND is a CODESYS Standard library string function declared as FUNCTION FIND : INT. It searches for the first occurrence of substring STR2 in string STR1 and returns the character position. If STR2 is not found in STR1, it returns 0.
| Language | structured text |
|---|---|
| Code | FIND |
| Group | String Functions |
| Syntax | FIND(STR1, STR2) |
| Dialect | CODESYS |
| Name | Data type | Description |
|---|---|---|
| FIND | INT | Character position of the first occurrence of STR2 in STR1; 0 if no occurrence is found. |
| STR1 | STRING(255) | String within which STR2 is searched. |
| STR2 | STRING(255) | String whose position is searched in STR1. |