Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Substring/Niue/substring.niue
Normal file
20
Task/Substring/Niue/substring.niue
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
( based on the JavaScript code )
|
||||
'abcdefgh 's ;
|
||||
s str-len 'len ;
|
||||
2 'n ;
|
||||
3 'm ;
|
||||
|
||||
( starting from n characters in and of m length )
|
||||
s n n m + substring . ( => cde ) newline
|
||||
|
||||
( starting from n characters in, up to the end of the string )
|
||||
s n len substring . ( => cdefgh ) newline
|
||||
|
||||
( whole string minus last character )
|
||||
s 0 len 1 - substring . ( => abcdefg ) newline
|
||||
|
||||
( starting from a known character within the string and of m length )
|
||||
s s 'b str-find dup m + substring . ( => bcd ) newline
|
||||
|
||||
( starting from a known substring within the string and of m length )
|
||||
s s 'bc str-find dup m + substring . ( => bcd ) newline
|
||||
Loading…
Add table
Add a link
Reference in a new issue