Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/String-matching/Standard-ML/string-matching.ml
Normal file
7
Task/String-matching/Standard-ML/string-matching.ml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
String.isPrefix "ab" "abcd"; (* returns true *)
|
||||
String.isSuffix "zn" "abcd"; (* returns false *)
|
||||
String.isSubstring "bb" "abab"; (* returns false *)
|
||||
String.isSubstring "ab" "abab"; (* returns true *)
|
||||
#2 (Substring.base (#2 (Substring.position "bb" (Substring.full "abab")))); (* returns 4 *)
|
||||
val loc = #2 (Substring.base (#2 (Substring.position "ab" (Substring.full "abab")))); (* returns 0 *)
|
||||
val loc' = #2 (Substring.base (#2 (Substring.position "ab" (Substring.extract ("abab", loc+1, NONE))))); (* returns 2 *)
|
||||
Loading…
Add table
Add a link
Reference in a new issue