RosettaCodeData/Task/Substring/Elixir/substring.elixir
2015-11-18 06:14:39 +00:00

5 lines
184 B
Text

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"