Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
26
Task/Substring/Phixmonti/substring.phixmonti
Normal file
26
Task/Substring/Phixmonti/substring.phixmonti
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
include ..\Utilitys.pmt
|
||||
|
||||
/#
|
||||
--(1) starting from n characters in and of m length;
|
||||
--(2) starting from n characters in, up to the end of the string;
|
||||
--(3) whole string minus last character;
|
||||
--(4) starting from a known character within the string and of m length;
|
||||
--(5) starting from a known substring within the string and of m length.
|
||||
#/
|
||||
|
||||
def myslice
|
||||
rot len var _|long
|
||||
rot rot
|
||||
over _|long swap - 1 +
|
||||
min
|
||||
slice
|
||||
enddef
|
||||
|
||||
"the last thing the man said was the"
|
||||
10 var n 5 var m
|
||||
|
||||
n m myslice ? /# (1) #/
|
||||
len n swap myslice ? /# (2) #/
|
||||
dup -1 del ? /# (3) #/
|
||||
'm' find m myslice ? /# (4) #/
|
||||
"aid" find m myslice ? /# (5) #/
|
||||
Loading…
Add table
Add a link
Reference in a new issue