Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Scroll tablelayout
sortDirectionASC
repeatTableHeadersdefaultstyle
widths16%, 11%, 13%, 60%
style
sortByColumn1
sortEnabledfalse
cellHighlightingtrue

...

Returns the zero based index of the location of the first character of the sub-string found. Returns -1 if not found.

Scroll pagebreak

Examples

Code Block
languagetext
// Search for a substring

...


string $str = "This is some text";

...


int $index;

...


 

...

// Search for the word "some"

...


$index = `strFind $str "some" 0`;

...


print $index; 

...

// Should be 8

...


 

...

// Search for the word "texas"

...


$index = `strFind $str "texas" 0`;

...


print $index; 

...

// Should be -1

...


 

...

// Search for the letter "t" after the word "some"

...


$index = `strFind $str "t" 12`;

...


print $index; 

...


// Should be 13

Additional information

Related commands

...