Skip to main content
Open topic with navigation CAPL Functions » General » Function Overview » mbstrstr, mbstrstr_off

mbstrstr, mbstrstr_off

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

long mbstrstr(char s1[], char s2[]);
long mbstrstr_off(char s1[], long offset, char s2[]);

Description

Searches in s1 for s2.

Parameters

  • s1: First string
  • s2: Second string
  • offset: Offset in s1 in characters at which the search shall be started

Return Values

First position in characters of s2 in s1, or -1 if s2 is not found in s1.

Example

long pos;
char s[50] = "'Tür' is german for 'door'";
pos = mbstrstr(s, "german");
write("%d", pos); // 9
strstrmbstrlenmbstrncpystrncat