1
Fork 0

Remove str::split

This commit is contained in:
Brian Anderson 2011-08-11 17:32:31 -07:00
parent 64f53dfbb0
commit e3e9811b7f

View file

@ -41,7 +41,6 @@ export shift_byte;
export pop_byte;
export push_byte;
export unshift_byte;
export split;
export split_ivec;
export concat;
export connect;
@ -435,21 +434,6 @@ fn unshift_byte(s: &mutable str, b: u8) {
s = rs;
}
fn split(s: str, sep: u8) -> vec[str] {
let v: vec[str] = [];
let accum: str = "";
let ends_with_sep: bool = false;
for c: u8 in s {
if c == sep {
v += [accum];
accum = "";
ends_with_sep = true;
} else { accum += unsafe_from_byte(c); ends_with_sep = false; }
}
if str::byte_len(accum) != 0u || ends_with_sep { v += [accum]; }
ret v;
}
fn split_ivec(s: str, sep: u8) -> [str] {
let v: [str] = ~[];
let accum: str = "";