Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Substring/Dyalect/substring.dyalect
Normal file
16
Task/Substring/Dyalect/substring.dyalect
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
let s = "0123456789"
|
||||
let n = 3
|
||||
let m = 2
|
||||
let c = '3'
|
||||
let z = "345"
|
||||
|
||||
// A: starting from n characters in and of m length;
|
||||
print(s.Substring(n, m))
|
||||
// B: starting from n characters in, up to the end of the string;
|
||||
print(s[n..])
|
||||
// C: whole string minus the last character;
|
||||
print(s[..-1])
|
||||
// D: starting from a known character within the string and of m length;
|
||||
print(s.Substring(s.IndexOf(c),m))
|
||||
// E: starting from a known substring within the string and of m length.
|
||||
print(s.Substring(s.IndexOf(z),m))
|
||||
Loading…
Add table
Add a link
Reference in a new issue