Findchar

From Mesham
Revision as of 15:45, 15 April 2019 by Polas (talk | contribs) (2 revisions imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Overview

This findchar(s, c) function will return the index of the first occurrence of character c in string s.

  • Pass: A String and Char
  • 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:=findchar(a,'l');
};

Since: Version 1.0