The findprev()
is an inbuilt function in julia which is used to return the previous occurrence of the specified pattern in specified string starting from specified position.
Syntax:
findnprev(pattern::AbstractString, string::AbstractString, start::Integer)
Parameters:
- pattern::AbstractString: Specified pattern
- string::AbstractString: Specified string
- start::Integer: It is the start position before which matching going to be performed.
Returns: It returns the previous occurrence of the specified pattern in a specified string starting from the specified position.
Example 1:
Println(findprev( "g" , "geeks" , 3 ))
Println(findprev( "G" , "GeeksforGeeks" , 10 ))
Println(findprev( "for" , "GeeksforGeeks" , 8 ))
Println(findprev( "k" , "GeeksforGeeks" , 7 ))
|
Output:

Example 2:
Println(findprev( "23" , "12345" , 5 ))
Println(findprev( "23" , "12345" , 4 ))
Println(findprev( "3" , "123123" , 6 ))
Println(findprev( "123" , "123123123" , 7 ))
|
Output:
