ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:strfind

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
functions:strfind [2017/03/20 09:57] korshunfunctions:strfind [2017/04/15 17:44] korshun
Line 5: Line 5:
 ===== Description ===== ===== Description =====
 Returns the position of the first occurence of what in s. If the string is not present, returns -1. Returns the position of the first occurence of what in s. If the string is not present, returns -1.
- 
- 
  
 ===== Examples ===== ===== Examples =====
Line 12: Line 10:
 StrFind("abcdefabc", "def") -> 3 StrFind("abcdefabc", "def") -> 3
 StrFind("abcdefabc", "abc") -> 0 // First occurence StrFind("abcdefabc", "abc") -> 0 // First occurence
 +StrFind("abcdef", "xyz") -> -1   // Not found
 StrFind("abcABCabc", "ABC") -> 3 // Case-insensitive StrFind("abcABCabc", "ABC") -> 3 // Case-insensitive
-StrFind("abcdef", "xyz") -> -1   // Not found+StrFind("ab", "abc") -> -1 // Not found 
 +StrFind("", "abc") -> -1 // Not found
 </code> </code>
  
Line 24: Line 24:
 </code> </code>
  
 +===== See also =====
 +  * [[StrRFind]]
 +  * [[StrFindFrom]]
 +  * [[StrRFindFrom]]
  
functions/strfind.txt · Last modified: 2020/12/24 13:12 by monsterovich