Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Substring/Yorick/substring.yorick
Normal file
16
Task/Substring/Yorick/substring.yorick
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
str = "abcdefgh";
|
||||
n = 2;
|
||||
m = 3;
|
||||
|
||||
// starting from n character in and of m length
|
||||
write, strpart(str, n:n+m-1);
|
||||
// starting from n character in, up to the end of the string
|
||||
write, strpart(str, n:);
|
||||
// whole string minus last character
|
||||
write, strpart(str, :-1);
|
||||
// starting from a known character within the string and of m length
|
||||
match = strfind("d", str);
|
||||
write, strpart(str, [match(1), match(1)+m]);
|
||||
// starting from a known substring within the string and of m length
|
||||
match = strfind("cd", str);
|
||||
write, strpart(str, [match(1), match(1)+m]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue