Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Substring/Elixir/substring.elixir
Normal file
12
Task/Substring/Elixir/substring.elixir
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
s = "abcdefgh"
|
||||
String.slice(s, 2, 3) #=> "cde"
|
||||
String.slice(s, 1..3) #=> "bcd"
|
||||
String.slice(s, -3, 2) #=> "fg"
|
||||
String.slice(s, 3..-1) #=> "defgh"
|
||||
|
||||
# UTF-8
|
||||
s = "αβγδεζηθ"
|
||||
String.slice(s, 2, 3) #=> "γδε"
|
||||
String.slice(s, 1..3) #=> "βγδ"
|
||||
String.slice(s, -3, 2) #=> "ζη"
|
||||
String.slice(s, 3..-1) #=> "δεζηθ"
|
||||
Loading…
Add table
Add a link
Reference in a new issue