Instring
Pos = Instring(SearchString$, FindString$, [Starting Pos=1], [CaseInSensitive=1])
 
Parameters:

    SearchString$ = The string you wish to search through
    FindString$ = The word or characters you wish to find
    [Starting Pos=1] = The character to start searching at
    [CaseInSensitive=1] = Flag to force the searching to be case sensitive or not (0=case sensitive, 1= case insensitive).
Returns:

    Pos = The character position of the found item (0 if not found)
 

      The Instring() function will locate the position of either words or characters within a string.



FACTS:


      * Instring returns a zero if the string was not found.




Mini Tutorial:


      This example uses the Instring to locate words and characters within the test strings.

  
  
; Find and display what character the word "Basic"
; start at within the string "Play Basic"
  Print InString("Play Basic","Basic",1,0)
  
; Find and display where the first "a" character
; is within the string "Play Basic"
  Print InString("Play Basic","a",1,0)
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  


This example would output.

  
  6.0
  3.0
  

 
Related Info: Mid | Mid$ | Replace$ | SplitToArray :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com