• Spring
  • jQuery
  • Struts
  • Servlet
  • Core Java
  • RubyonRails
  • SQL Tutorial
  • JavaScript
  • JSP

  • <

    Rust Slice

    Slice is used to contiguous memory allocation.It is used with data structures like arrays, vectors and strings.

    Slices behave like arrays.Slice size determined at run time.Slices are pointers to the actual data.

    Rust Slice Example


    
    fn main() {
       let n1 = "world".to_string();
       println!("length of string is {}",n1.len());
       let c1 = &n1[2..3];   
     
       println!("{}",c1);
    }
    

    Output:
    capture
















    © copyright 2017-2021 Completedone pvt ltd.