Logo

Programming-Idioms

History of Idiom 38 > diff from v61 to v62

Edit summary for version 62 by programming-idioms.org:
[Rust] This doesn't seem to work, could you please provide a working demo?

Version 61

2020-10-21, 00:46:16

Version 62

2020-10-24, 19:25:54

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/