Instr.htm 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>Instr (string1$, string2$, offset)</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. string1$ = the string you wish to search <br />
  13. string2$ = the string to find <br />
  14. offset = valid integer starting position to being search (optional)
  15. </td>
  16. </tr>
  17. </table>
  18. <h1>Description</h1>
  19. <table>
  20. <tr>
  21. <td>
  22. This command will allow you to search for an occurance of a string within another string. The command returns the location (number of characters from the left) of the string you are looking for. Command returns a Zero if no matches are found.
  23. </td>
  24. </tr>
  25. </table>
  26. <h1><a href=../2d_examples/Instr.bb>Example</a></h1>
  27. <table>
  28. <tr>
  29. <td>
  30. name$="Shane R. Monroe" <br />
  31. location = Instr( name$,"R.",1) <br />
  32. Print "Your string contains 'R.' at position number " + location + "!" <br />
  33. </td>
  34. </tr>
  35. </table>
  36. <br>
  37. <a target=_top href=../index.htm>Index</a><br>
  38. <br>
  39. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=Instr&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  40. </html>