Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (** Verifica se uma string é substring de outra.
- @param stringToBeFound Cadeia de caracteres pelo qual procuramos
- @param stringToBeChecked Cadeia de caracteres aonde procurar *)
- and checkIfStringIsContainedIn stringToBeFound stringToBeChecked initialPos =
- if initialPos < String.length stringToBeChecked &&
- length stringToBeChecked <= length stringToBeFound then
- ( let subString = (String.sub stringToBeChecked initialPos (String.length stringToBeFound)) in
- if stringToBeFound = subString then true
- else checkIfStringIsContainedIn stringToBeFound subString (initialPos+1) )
- else false
Add Comment
Please, Sign In to add comment