Difference between revisions of "Findstr"

From Mesham
Jump to navigationJump to search
(Created page with '== Overview == This findstr(s, s2) function will return the index of the first occurrence of search string ''s2'' in text string ''s''. * '''Pass:''' Two Strings * '…')
 
Line 10: Line 10:
  
 
  #include <string>
 
  #include <string>
  var a:="hello";
+
   
var c:=findstr(a,'el');
+
function void main() {
 +
    var a:="hello";
 +
    var c:=findstr(a,'el');
 +
};
  
 
''Since: Version 1.0''
 
''Since: Version 1.0''

Revision as of 14:34, 15 April 2013

Overview

This findstr(s, s2) function will return the index of the first occurrence of search string s2 in text string s.

  • Pass: Two Strings
  • Returns: An Int
  • Throws: The error string notfound if the character does not exist within the string

Example

#include <string>

function void main() {
   var a:="hello";
   var c:=findstr(a,'el');
};

Since: Version 1.0