Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
22
Task/Substring/Wart/substring.wart
Normal file
22
Task/Substring/Wart/substring.wart
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
s <- "abcdefgh"
|
||||
s.0
|
||||
=> "a"
|
||||
|
||||
# starting from n characters in and of m length;
|
||||
def (substr s start len)
|
||||
(s start start+len)
|
||||
(substr s 3 2)
|
||||
=> "de"
|
||||
|
||||
# starting from n characters in, up to the end of the string
|
||||
(s 3 nil)
|
||||
=> "defgh"
|
||||
|
||||
# whole string minus last character;
|
||||
(s 3 -1)
|
||||
=> "defg"
|
||||
|
||||
# starting from a known character within the string and of <tt>m</tt> length;
|
||||
# starting from a known substring within the string and of <tt>m</tt> length.
|
||||
let start (pos s pat)
|
||||
(s start start+m)
|
||||
Loading…
Add table
Add a link
Reference in a new issue