Difference between revisions of "Findrchar"
From Mesham
Jump to navigationJump to search (Created page with '== Overview == This findrchar(s, c) function will return the index of the last occurrence of character ''c'' in string ''s''. * '''Pass:''' A String and Char * '''Retur…') |
m (2 revisions imported) |
||
(One intermediate revision by the same user not shown) | |||
Line 10: | Line 10: | ||
#include <string> | #include <string> | ||
− | var a:="hello"; | + | |
− | + | function void main() { | |
+ | var a:="hello"; | ||
+ | var c:=findrchar(a,'l'); | ||
+ | }; | ||
''Since: Version 1.0'' | ''Since: Version 1.0'' |
Latest revision as of 15:45, 15 April 2019
Overview
This findrchar(s, c) function will return the index of the last 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:=findrchar(a,'l'); };
Since: Version 1.0