pub fn trim(l: &String, start: usize, end: usize) -> (String, usize, usize) {
        let mut line = l.clone();
        let mut first: usize = 0;
        let mut last: usize = 0;
        let mut hit_text = false;
        for i in (0..len(&line) - end).rev() {
            let next = slice(&line, i..i + 1);
            if !hit_text && (next == " " || next == "\t") {
                line = remove(&line, i, 1);
            } else {
            	first = i;
                hit_text = true;
            }
        }
        hit_text = false;
        let mut i = start;
        while i < len(&line) - end {
            let next = slice(&line, i..i + 1);
            if !hit_text && (next == " " || next == "\t") {
                line = remove(&line, i, 1);
            } else {
                hit_text = true;
                last = i;
                i += 1;
            }
        }
        (line, first, last)
    }
/*
    removes whitespace around given string from start and end indices
    */
removes whitespace around given string from start and end indices
removes whitespace around given string from start and end indices
pub fn trim(l: &String, start: usize, end: usize) -> (String, usize, usize) {
        let mut line = l.clone();
        let mut first: usize = 0;
        let mut last: usize = 0;
        let mut hit_text = false;
        for i in (0..len(&line) - end).rev() {
            let next = slice(&line, i..i + 1);
            if !hit_text && (next == " " || next == "\t") {
                line = remove(&line, i, 1);
            } else {
            	first = i;
                hit_text = true;
            }
        }
        hit_text = false;
        let mut i = start;
        while i < len(&line) - end {
            let next = slice(&line, i..i + 1);
            if !hit_text && (next == " " || next == "\t") {
                line = remove(&line, i, 1);
            } else {
                hit_text = true;
                last = i;
                i += 1;
            }
        }
        (line, first, last)
    }
pub fn trim ( l : & String , start : usize , end : usize ) -> ( String , usize , usize ) { let mut line = l . clone ( ) ; let mut first : usize = 0 ; let mut last : usize = 0 ; let mut hit_text = false ; for i in ( 0 .. len ( & line ) - end ) . rev ( ) { let next = slice ( & line , i .. i + 1 ) ; if ! hit_text && ( next == " " || next == " \t " ) { line = remove ( & line , i , 1 ) ; } else { first = i ; hit_text = true ; } } hit_text = false ; let mut i = start ; while i < len ( & line ) - end { let next = slice ( & line , i .. i + 1 ) ; if ! hit_text && ( next == " " || next == " \t " ) { line = remove ( & line , i , 1 ) ; } else { hit_text = true ; last = i ; i += 1 ; } } ( line , first , last ) }
removes whitespace around given string from start and end indices
removes whitespace around given string from start and end indices
l
&String
start
usize
end
usize
l
&String
start
usize
end
usize