Logo

Programming-Idioms

History of Idiom 38 > diff from v63 to v64

Edit summary for version 64 by programming-idioms.org:
[Rust] Works fine but not on play.rust-lang.org

Version 63

2020-11-26, 12:00:49

Version 64

2020-12-09, 15:57:57

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Illustration

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Illustration
Variables
t,i,j,s
Variables
t,i,j,s
Imports
use substring::Substring;
Imports
use substring::Substring;
Code
let t = s.substring(i, j);
Code
let t = s.substring(i, j);
Comments bubble
This doesn't seem to work, could you please provide a working demo?
Doc URL
https://docs.rs/substring/
Doc URL
https://docs.rs/substring/